mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
fix #46632
This commit is contained in:
parent
e94f77ab65
commit
66b50b40fe
|
@ -206,6 +206,18 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|||
}
|
||||
});
|
||||
|
||||
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
id: 'goToNextReferenceFromEmbeddedEditor',
|
||||
weight: KeybindingsRegistry.WEIGHT.editorContrib(50),
|
||||
primary: KeyCode.F4,
|
||||
when: PeekContext.inPeekEditor,
|
||||
handler(accessor) {
|
||||
withController(accessor, controller => {
|
||||
controller.goToNextOrPreviousReference(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
id: 'goToPreviousReference',
|
||||
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50),
|
||||
|
@ -218,6 +230,18 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|||
}
|
||||
});
|
||||
|
||||
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
id: 'goToPreviousReferenceFromEmbeddedEditor',
|
||||
weight: KeybindingsRegistry.WEIGHT.editorContrib(50),
|
||||
primary: KeyMod.Shift | KeyCode.F4,
|
||||
when: PeekContext.inPeekEditor,
|
||||
handler(accessor) {
|
||||
withController(accessor, controller => {
|
||||
controller.goToNextOrPreviousReference(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
id: 'closeReferenceSearch',
|
||||
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50),
|
||||
|
|
|
@ -175,13 +175,15 @@ export class ReferencesController implements editorCommon.IEditorContribution {
|
|||
}
|
||||
|
||||
public async goToNextOrPreviousReference(fwd: boolean) {
|
||||
let source = this._model.nearestReference(this._editor.getModel().uri, this._widget.position);
|
||||
let target = this._model.nextOrPreviousReference(source, fwd);
|
||||
let editorFocus = this._editor.isFocused();
|
||||
await this._widget.setSelection(target);
|
||||
await this._gotoReference(target);
|
||||
if (editorFocus) {
|
||||
this._editor.focus();
|
||||
if (this._model) { // can be called while still resolving...
|
||||
let source = this._model.nearestReference(this._editor.getModel().uri, this._widget.position);
|
||||
let target = this._model.nextOrPreviousReference(source, fwd);
|
||||
let editorFocus = this._editor.isFocused();
|
||||
await this._widget.setSelection(target);
|
||||
await this._gotoReference(target);
|
||||
if (editorFocus) {
|
||||
this._editor.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue