Skip to content

Commit e52aa6a

Browse files
author
aiday-mar
committed
Changes from review
1 parent d789de4 commit e52aa6a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,7 @@ export abstract class SymbolNavigationAction extends EditorAction {
232232
private _openInPeek(target: ICodeEditor, model: ReferencesModel, range?: Range) {
233233
const controller = ReferencesController.get(target);
234234
if (controller && target.hasModel()) {
235-
if (range) {
236-
controller.toggleWidget(range, createCancelablePromise(_ => Promise.resolve(model)), this.configuration.openInPeek);
237-
} else {
238-
controller.toggleWidget(target.getSelection(), createCancelablePromise(_ => Promise.resolve(model)), this.configuration.openInPeek);
239-
}
235+
controller.toggleWidget(range ?? target.getSelection(), createCancelablePromise(_ => Promise.resolve(model)), this.configuration.openInPeek);
240236
} else {
241237
model.dispose();
242238
}

src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ export async function goToDefinitionWithLocation(accessor: ServicesAccessor, eve
106106
const canPeek = !openToSide && editor.getOption(EditorOption.definitionLinkOpensInPeek) && !isInPeek;
107107

108108
const action = new DefinitionAction({ openToSide, openInPeek: canPeek, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined });
109-
const locationRange = location.range;
110-
return action.run(accessor, editor, { model: ref.object.textEditorModel, position: Range.getStartPosition(locationRange) }, new Range(locationRange.startLineNumber, locationRange.startColumn, locationRange.endLineNumber, locationRange.endColumn));
109+
return action.run(accessor, editor, { model: ref.object.textEditorModel, position: Range.getStartPosition(location.range) }, Range.lift(location.range));
111110
});
112111

113112
ref.dispose();

0 commit comments

Comments
 (0)