-
Notifications
You must be signed in to change notification settings - Fork 4
highlight line #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
highlight line #193
Conversation
| "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? |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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...
|
Danke @hannesbraun Ich hab ein paar Dinge gefixt, hoffentlich auch den Bug. 100% reproduzieren konnte ich ihn nicht. |
No description provided.