Skip to content

Commit

Permalink
alternative action cannot be action itself, #73081
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Nov 22, 2019
1 parent 92735e1 commit 01cc500
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/vs/editor/contrib/gotoSymbol/goToCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { EditorOption, GoToLocationValues } from 'vs/editor/common/config/editor
import { isStandalone } from 'vs/base/browser/browser';
import { URI } from 'vs/base/common/uri';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ScrollType } from 'vs/editor/common/editorCommon';
import { ScrollType, IEditorAction } from 'vs/editor/common/editorCommon';
import { assertType } from 'vs/base/common/types';


Expand Down Expand Up @@ -82,8 +82,15 @@ abstract class SymbolNavigationAction extends EditorAction {

alert(references.ariaMessage);

let altAction: IEditorAction | null | undefined;
if (references.referenceAt(model.uri, pos)) {
const altActionId = this._getAlternativeCommand(editor);
if (altActionId !== this.id) {
altAction = editor.getAction(altActionId);
}
}

const referenceCount = references.references.length;
const altAction = references.referenceAt(model.uri, pos) && editor.getAction(this._getAlternativeCommand(editor));

if (referenceCount === 0) {
// no result -> show message
Expand Down

0 comments on commit 01cc500

Please sign in to comment.