Path: blob/main/src/vs/workbench/contrib/comments/common/commentContextKeys.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import * as nls from '../../../../nls.js';6import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';789export namespace CommentContextKeys {1011/**12* A context key that is set when the active cursor is in a commenting range.13*/14export const activeCursorHasCommentingRange = new RawContextKey<boolean>('activeCursorHasCommentingRange', false, {15description: nls.localize('hasCommentingRange', "Whether the position at the active cursor has a commenting range"),16type: 'boolean'17});1819/**20* A context key that is set when the active cursor is in the range of an existing comment.21*/22export const activeCursorHasComment = new RawContextKey<boolean>('activeCursorHasComment', false, {23description: nls.localize('hasComment', "Whether the position at the active cursor has a comment"),24type: 'boolean'25});2627/**28* A context key that is set when the active editor has commenting ranges.29*/30export const activeEditorHasCommentingRange = new RawContextKey<boolean>('activeEditorHasCommentingRange', false, {31description: nls.localize('editorHasCommentingRange', "Whether the active editor has a commenting range"),32type: 'boolean'33});3435/**36* A context key that is set when the workspace has either comments or commenting ranges.37*/38export const WorkspaceHasCommenting = new RawContextKey<boolean>('workspaceHasCommenting', false, {39description: nls.localize('hasCommentingProvider', "Whether the open workspace has either comments or commenting ranges."),40type: 'boolean'41});4243/**44* A context key that is set when the comment thread has no comments.45*/46export const commentThreadIsEmpty = new RawContextKey<boolean>('commentThreadIsEmpty', false, { type: 'boolean', description: nls.localize('commentThreadIsEmpty', "Set when the comment thread has no comments") });47/**48* A context key that is set when the comment has no input.49*/50export const commentIsEmpty = new RawContextKey<boolean>('commentIsEmpty', false, { type: 'boolean', description: nls.localize('commentIsEmpty', "Set when the comment has no input") });51/**52* The context value of the comment.53*/54export const commentContext = new RawContextKey<string>('comment', undefined, { type: 'string', description: nls.localize('comment', "The context value of the comment") });55/**56* The context value of the comment thread.57*/58export const commentThreadContext = new RawContextKey<string>('commentThread', undefined, { type: 'string', description: nls.localize('commentThread', "The context value of the comment thread") });59/**60* The comment controller id associated with a comment thread.61*/62export const commentControllerContext = new RawContextKey<string>('commentController', undefined, { type: 'string', description: nls.localize('commentController', "The comment controller id associated with a comment thread") });6364/**65* The comment widget is focused.66*/67export const commentFocused = new RawContextKey<boolean>('commentFocused', false, { type: 'boolean', description: nls.localize('commentFocused', "Set when the comment is focused") });6869/**70* A context key that is set when commenting is enabled.71*/72export const commentingEnabled = new RawContextKey<boolean>('commentingEnabled', true, {73description: nls.localize('commentingEnabled', "Whether commenting functionality is enabled"),74type: 'boolean'75});76}777879