Skip to content

Conversation

@skogsbaer
Copy link
Owner

No description provided.

"updateLineHighlight: removing highlighting in " + editor.document.fileName);
editor.setDecorations(nextLineExecuteHighlightType, []);
} else if (editor.document.lineCount < traceLine) {
// How can it be that traceLine is out of range?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The document/source file might have changed since the visualization was computed. If we start the visualization and remove all content from the source file, we need to remove the line highlighting.


// State Types for the Frontend
type FrontendTrace = Array<FrontendTraceElem>;
// FIXME: what are this array elements? Why isn't there a type with named fields?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See generateHTML in HTMLGenerator.ts: it corresponds to a single rendered visualization step. It has the following elements:

  • Line number
  • the stack rendered as an HTML fragment
  • the heap rendered as an HTML fragment
  • current filename
  • the current state of the output

I don't know why there isn't a type with named fields. It was already solved this way before I integrated the visualization into the WYPP plugin and to be honest, I just did not fix it because it already worked and my main main focus was to get everything working.


if (nextLine > -1) {
this.setEditorDecorations(editor, nextLineExecuteHighlightType, nextLine);
const hlLine = traceLine - 1; // why - 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

traceLine is one-based, VSCode works with zero-based line indices though.

"updateLineHighlight: highlighting line " + hlLine + " in " + editor.document.fileName);
this.setEditorDecorations(editor, nextLineExecuteHighlightType, hlLine);
} else {
// how can this happen?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. Maybe there was a way that this could happen back when the trace was generated though the Debug Adapter Protocol. I don't know why this should happen with the current trace generator. I probably left it there, just in case...

@skogsbaer skogsbaer merged commit c663f34 into master Nov 26, 2025
7 checks passed
@skogsbaer
Copy link
Owner Author

Danke @hannesbraun Ich hab ein paar Dinge gefixt, hoffentlich auch den Bug. 100% reproduzieren konnte ich ihn nicht.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants