Skip to content

Commit

Permalink
peek def action should check if it's for a nested editor, #6786
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed May 25, 2016
1 parent 4730f96 commit 0ac95a8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import {getDeclarationsAtPosition} from 'vs/editor/contrib/goToDeclaration/commo
import {ReferencesController} from 'vs/editor/contrib/referenceSearch/browser/referencesController';
import {ReferencesModel} from 'vs/editor/contrib/referenceSearch/browser/referencesModel';
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import {IPeekViewService} from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget';
import {optional} from 'vs/platform/instantiation/common/instantiation';


export class DefinitionActionConfig {

Expand Down Expand Up @@ -189,10 +192,16 @@ export class PeekDefinitionAction extends DefinitionAction {
descriptor: editorCommon.IEditorActionDescriptorData,
editor: editorCommon.ICommonCodeEditor,
@IMessageService messageService: IMessageService,
@IEditorService editorService: IEditorService
@IEditorService editorService: IEditorService,
@optional(IPeekViewService) private _peekViewService: IPeekViewService
) {
super(descriptor, editor, messageService, editorService, new DefinitionActionConfig(void 0, void 0, true, false));
}

getEnablementState(): boolean {
return (!this._peekViewService || !this._peekViewService.isActive)
&& super.getEnablementState();
}
}

// --- Editor Contribution to goto definition using the mouse and a modifier key
Expand Down

0 comments on commit 0ac95a8

Please sign in to comment.