Skip to content

Commit

Permalink
refresh inlay hints immediately after applying inlay hint edits, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Apr 19, 2022
1 parent 8edff91 commit 2908387
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ export class InlayHintsController implements IEditorContribution {
}

// mouse gestures
this._sessionDisposables.add(this._installDblClickGesture(() => scheduler.schedule(0)));
this._sessionDisposables.add(this._installLinkGesture());
this._sessionDisposables.add(this._installDblClickGesture());
this._sessionDisposables.add(this._installContextMenu());
}

Expand Down Expand Up @@ -329,7 +329,7 @@ export class InlayHintsController implements IEditorContribution {
return Array.from(lineHints);
}

private _installDblClickGesture(): IDisposable {
private _installDblClickGesture(updateInlayHints: Function): IDisposable {
return this._editor.onMouseUp(async e => {
if (e.event.detail !== 2) {
return;
Expand All @@ -343,6 +343,7 @@ export class InlayHintsController implements IEditorContribution {
if (isNonEmptyArray(part.item.hint.textEdits)) {
const edits = part.item.hint.textEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text));
this._editor.executeEdits('inlayHint.default', edits);
updateInlayHints();
}
});
}
Expand Down

0 comments on commit 2908387

Please sign in to comment.