mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
"Go to Definition" with multiple definitions and "Peek Definition" change preview editor statuses differently (fix #152914) (#168275)
This commit is contained in:
parent
c0f6c67a09
commit
dd86970478
|
@ -126,7 +126,7 @@ export abstract class ReferencesController implements IEditorContribution {
|
||||||
break;
|
break;
|
||||||
case 'goto':
|
case 'goto':
|
||||||
if (peekMode) {
|
if (peekMode) {
|
||||||
this._gotoReference(element);
|
this._gotoReference(element, true);
|
||||||
} else {
|
} else {
|
||||||
this.openReference(element, false, true);
|
this.openReference(element, false, true);
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ export abstract class ReferencesController implements IEditorContribution {
|
||||||
const editorFocus = this._editor.hasTextFocus();
|
const editorFocus = this._editor.hasTextFocus();
|
||||||
const previewEditorFocus = this._widget.isPreviewEditorFocused();
|
const previewEditorFocus = this._widget.isPreviewEditorFocused();
|
||||||
await this._widget.setSelection(target);
|
await this._widget.setSelection(target);
|
||||||
await this._gotoReference(target);
|
await this._gotoReference(target, false);
|
||||||
if (editorFocus) {
|
if (editorFocus) {
|
||||||
this._editor.focus();
|
this._editor.focus();
|
||||||
} else if (this._widget && previewEditorFocus) {
|
} else if (this._widget && previewEditorFocus) {
|
||||||
|
@ -237,7 +237,7 @@ export abstract class ReferencesController implements IEditorContribution {
|
||||||
this._requestIdPool += 1; // Cancel pending requests
|
this._requestIdPool += 1; // Cancel pending requests
|
||||||
}
|
}
|
||||||
|
|
||||||
private _gotoReference(ref: Location): Promise<any> {
|
private _gotoReference(ref: Location, pinned: boolean): Promise<any> {
|
||||||
this._widget?.hide();
|
this._widget?.hide();
|
||||||
|
|
||||||
this._ignoreModelChangeEvent = true;
|
this._ignoreModelChangeEvent = true;
|
||||||
|
@ -245,7 +245,7 @@ export abstract class ReferencesController implements IEditorContribution {
|
||||||
|
|
||||||
return this._editorService.openCodeEditor({
|
return this._editorService.openCodeEditor({
|
||||||
resource: ref.uri,
|
resource: ref.uri,
|
||||||
options: { selection: range, selectionSource: TextEditorSelectionSource.JUMP }
|
options: { selection: range, selectionSource: TextEditorSelectionSource.JUMP, pinned }
|
||||||
}, this._editor).then(openedEditor => {
|
}, this._editor).then(openedEditor => {
|
||||||
this._ignoreModelChangeEvent = false;
|
this._ignoreModelChangeEvent = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue