Skip to content
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

12970 Fixes hover widget jumping #12971

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/debug/src/browser/editor/debug-hover-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,22 @@ export class DebugHoverWidget extends SourceTreeWidget implements monaco.editor.
this.hide();
return;
}
const expressionLineContent = this.editor
.getControl()
.getModel()!
.getLineContent(this.options.selection.startLineNumber);
const startColumn =
expressionLineContent.indexOf(
matchingExpression,
this.options.selection.startColumn - matchingExpression.length
) + 1;
const endColumn = startColumn + matchingExpression.length;
this.options.selection = new monaco.Range(
this.options.selection.startLineNumber,
startColumn,
this.options.selection.startLineNumber,
endColumn
);
const toFocus = new DisposableCollection();
if (this.options.focus === true) {
toFocus.push(this.model.onNodeRefreshed(() => {
Expand Down
Loading