提交 d7953d03 编写于 作者: J Johannes Rieken

fix #86321

上级 b1ed55a7
......@@ -24,7 +24,7 @@ import { Range } from 'vs/editor/common/core/range';
import { IPosition } from 'vs/editor/common/core/position';
import { MenuId } from 'vs/platform/actions/common/actions';
const _ctxHasCompletionItemProvider = new RawContextKey<boolean>('editorHasCallHierarchyProvider', false);
const _ctxHasCallHierarchyProvider = new RawContextKey<boolean>('editorHasCallHierarchyProvider', false);
const _ctxCallHierarchyVisible = new RawContextKey<boolean>('callHierarchyVisible', false);
class CallHierarchyController implements IEditorContribution {
......@@ -52,7 +52,7 @@ class CallHierarchyController implements IEditorContribution {
@IInstantiationService private readonly _instantiationService: IInstantiationService,
) {
this._ctxIsVisible = _ctxCallHierarchyVisible.bindTo(this._contextKeyService);
this._ctxHasProvider = _ctxHasCompletionItemProvider.bindTo(this._contextKeyService);
this._ctxHasProvider = _ctxHasCallHierarchyProvider.bindTo(this._contextKeyService);
this._dispoables.add(Event.any<any>(_editor.onDidChangeModel, _editor.onDidChangeModelLanguage, CallHierarchyProviderRegistry.onDidChange)(() => {
this._ctxHasProvider.set(_editor.hasModel() && CallHierarchyProviderRegistry.has(_editor.getModel()));
}));
......@@ -172,8 +172,7 @@ registerEditorAction(class extends EditorAction {
primary: KeyMod.Shift + KeyMod.Alt + KeyCode.KEY_H
},
precondition: ContextKeyExpr.and(
_ctxCallHierarchyVisible.negate(),
_ctxHasCompletionItemProvider,
_ctxHasCallHierarchyProvider,
PeekContext.notInPeekEditor
)
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册