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