Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
a-miscellaneous committed Oct 29, 2023
1 parent c3fc36d commit 514f9e2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
19 changes: 13 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ def getVars(self):
if symbol.is_variable:
dic[symbol.name] = symbol.value(frame).format_string()

for symbol in block:
if symbol.is_variable:
dic[symbol.name] = symbol.value(frame).format_string()
while block:
for symbol in block:
if symbol.is_variable:
dic[symbol.name] = symbol.value(frame).format_string()

if symbol.is_argument and symbol.name not in dic:
dic[symbol.name] = symbol.value(frame).format_string()
if symbol.is_argument and symbol.name not in dic:
dic[symbol.name] = symbol.value(frame).format_string()
block = block.superblock

return dic if len(dic) > 0 else None

Expand Down Expand Up @@ -122,8 +124,13 @@ def saveAssiggnmentHistory(self, line: int, oldlocals: dict, oldLineStr: str, st
# if no changes detected, attempt to find a var in the line and then save it
assignmentRegX = r"([^\"\'])(\s*)([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(\+\=|\-\=|\*\=|\/\=|\%\=|\=)(\s*)([a-zA-Z0-9_]+|\-?[0-9]+(\.[0-9]+)?)"
match = re.search(assignmentRegX, oldLineStr)
if match and match.group(3).strip in newLocals:
print('match', oldLineStr, )
if match:
res = match.group(3).strip()
if newLocals.get(res) is None:
print("var " + match.group(3).strip() + " not in locals", )
return

obj = {"line": line, "value": oldlocals[res], "var": res,
"file": file, "stackHeight": stackHeight, "step": currentStep}
print("appended obj no change", obj)
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function activate(context: vscode.ExtensionContext) {
setHTMLcontent(panel, htmlContent[currentFile].join(""), scriptPath, cssPath);


// TODO: test

vscode.window.onDidChangeTextEditorSelection(() => {
const currentFile = path.parse(utils.getActiveDocument()).base;
if (!currentFile) { return; }
Expand Down
3 changes: 1 addition & 2 deletions src/html_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ function getHTMLperLine(lineHistory: interfaces.LineMapping): string[] {


function getHTMLperArgsHistory(argsHistory: interfaces.ArgsHistory): string {
// TODO: implement
return `<div class="entry column-width editor-height" id="name-${argsHistory.functionName}"> TODO</div>`;
return `<div class="entry column-width editor-height" id="name-${argsHistory.functionName}"> arg</div>`;
}

function getHTMLperLineHistory(lineHistory: interfaces.LineHistory): string {
Expand Down
2 changes: 1 addition & 1 deletion src/webview/webview_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function getMaxEntryWidth(line, font) {
maxWidth = width;
}
}
return Math.ceil(maxWidth) + 4; // TODO remove base
return Math.ceil(maxWidth) + 4;
}

function initWidths() {
Expand Down

0 comments on commit 514f9e2

Please sign in to comment.