/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; export namespace EditorContextKeys { export const editorSimpleInput = new RawContextKey('editorSimpleInput', false); /** * A context key that is set when the editor's text has focus (cursor is blinking). * Is false when focus is in simple editor widgets (repl input, scm commit input). */ export const editorTextFocus = new RawContextKey('editorTextFocus', false); /** * A context key that is set when the editor's text or an editor's widget has focus. */ export const focus = new RawContextKey('editorFocus', false); /** * A context key that is set when any editor input has focus (regular editor, repl input...). */ export const textInputFocus = new RawContextKey('textInputFocus', false); export const readOnly = new RawContextKey('editorReadonly', false); export const inDiffEditor = new RawContextKey('inDiffEditor', false); export const columnSelection = new RawContextKey('editorColumnSelection', false); export const writable = readOnly.toNegated(); export const hasNonEmptySelection = new RawContextKey('editorHasSelection', false); export const hasOnlyEmptySelection = hasNonEmptySelection.toNegated(); export const hasMultipleSelections = new RawContextKey('editorHasMultipleSelections', false); export const hasSingleSelection = hasMultipleSelections.toNegated(); export const tabMovesFocus = new RawContextKey('editorTabMovesFocus', false); export const tabDoesNotMoveFocus = tabMovesFocus.toNegated(); export const isInWalkThroughSnippet = new RawContextKey('isInEmbeddedEditor', false); export const canUndo = new RawContextKey('canUndo', false); export const canRedo = new RawContextKey('canRedo', false); export const hoverVisible = new RawContextKey('editorHoverVisible', false); /** * A context key that is set when an editor is part of a larger editor, like notebooks or * (future) a diff editor */ export const inCompositeEditor = new RawContextKey('inCompositeEditor', undefined); export const notInCompositeEditor = inCompositeEditor.toNegated(); // -- mode context keys export const languageId = new RawContextKey('editorLangId', ''); export const hasCompletionItemProvider = new RawContextKey('editorHasCompletionItemProvider', false); export const hasCodeActionsProvider = new RawContextKey('editorHasCodeActionsProvider', false); export const hasCodeLensProvider = new RawContextKey('editorHasCodeLensProvider', false); export const hasDefinitionProvider = new RawContextKey('editorHasDefinitionProvider', false); export const hasDeclarationProvider = new RawContextKey('editorHasDeclarationProvider', false); export const hasImplementationProvider = new RawContextKey('editorHasImplementationProvider', false); export const hasTypeDefinitionProvider = new RawContextKey('editorHasTypeDefinitionProvider', false); export const hasHoverProvider = new RawContextKey('editorHasHoverProvider', false); export const hasDocumentHighlightProvider = new RawContextKey('editorHasDocumentHighlightProvider', false); export const hasDocumentSymbolProvider = new RawContextKey('editorHasDocumentSymbolProvider', false); export const hasReferenceProvider = new RawContextKey('editorHasReferenceProvider', false); export const hasRenameProvider = new RawContextKey('editorHasRenameProvider', false); export const hasSignatureHelpProvider = new RawContextKey('editorHasSignatureHelpProvider', false); // -- mode context keys: formatting export const hasDocumentFormattingProvider = new RawContextKey('editorHasDocumentFormattingProvider', false); export const hasDocumentSelectionFormattingProvider = new RawContextKey('editorHasDocumentSelectionFormattingProvider', false); export const hasMultipleDocumentFormattingProvider = new RawContextKey('editorHasMultipleDocumentFormattingProvider', false); export const hasMultipleDocumentSelectionFormattingProvider = new RawContextKey('editorHasMultipleDocumentSelectionFormattingProvider', false); }