Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/outline/browser/outline.contribution.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 { localize, localize2 } from '../../../../nls.js';
7
import { IViewsRegistry, Extensions as ViewExtensions } from '../../../common/views.js';
8
import { OutlinePane } from './outlinePane.js';
9
import { Registry } from '../../../../platform/registry/common/platform.js';
10
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from '../../../../platform/configuration/common/configurationRegistry.js';
11
import { VIEW_CONTAINER } from '../../files/browser/explorerViewlet.js';
12
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';
13
import { Codicon } from '../../../../base/common/codicons.js';
14
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
15
import { OutlineConfigKeys } from '../../../services/outline/browser/outline.js';
16
import { IOutlinePane } from './outline.js';
17
18
// --- actions
19
20
import './outlineActions.js';
21
22
// --- view
23
24
const outlineViewIcon = registerIcon('outline-view-icon', Codicon.symbolClass, localize('outlineViewIcon', 'View icon of the outline view.'));
25
26
Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{
27
id: IOutlinePane.Id,
28
name: localize2('name', "Outline"),
29
containerIcon: outlineViewIcon,
30
ctorDescriptor: new SyncDescriptor(OutlinePane),
31
canToggleVisibility: true,
32
canMoveView: true,
33
hideByDefault: false,
34
collapsed: true,
35
order: 2,
36
weight: 30,
37
focusCommand: { id: 'outline.focus' }
38
}], VIEW_CONTAINER);
39
40
// --- configurations
41
42
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
43
'id': 'outline',
44
'order': 117,
45
'title': localize('outlineConfigurationTitle', "Outline"),
46
'type': 'object',
47
'properties': {
48
[OutlineConfigKeys.icons]: {
49
'description': localize('outline.showIcons', "Render Outline elements with icons."),
50
'type': 'boolean',
51
'default': true
52
},
53
[OutlineConfigKeys.collapseItems]: {
54
'description': localize('outline.initialState', "Controls whether Outline items are collapsed or expanded."),
55
'type': 'string',
56
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
57
'enum': [
58
'alwaysCollapse',
59
'alwaysExpand'
60
],
61
'enumDescriptions': [
62
localize('outline.initialState.collapsed', "Collapse all items."),
63
localize('outline.initialState.expanded', "Expand all items.")
64
],
65
'default': 'alwaysExpand'
66
},
67
[OutlineConfigKeys.problemsEnabled]: {
68
'markdownDescription': localize('outline.showProblem', "Show errors and warnings on Outline elements. Overwritten by {0} when it is off.", '`#problems.visibility#`'),
69
'type': 'boolean',
70
'default': true
71
},
72
[OutlineConfigKeys.problemsColors]: {
73
'markdownDescription': localize('outline.problem.colors', "Use colors for errors and warnings on Outline elements. Overwritten by {0} when it is off.", '`#problems.visibility#`'),
74
'type': 'boolean',
75
'default': true
76
},
77
[OutlineConfigKeys.problemsBadges]: {
78
'markdownDescription': localize('outline.problems.badges', "Use badges for errors and warnings on Outline elements. Overwritten by {0} when it is off.", '`#problems.visibility#`'),
79
'type': 'boolean',
80
'default': true
81
},
82
'outline.showFiles': {
83
type: 'boolean',
84
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
85
default: true,
86
markdownDescription: localize('filteredTypes.file', "When enabled, Outline shows `file`-symbols.")
87
},
88
'outline.showModules': {
89
type: 'boolean',
90
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
91
default: true,
92
markdownDescription: localize('filteredTypes.module', "When enabled, Outline shows `module`-symbols.")
93
},
94
'outline.showNamespaces': {
95
type: 'boolean',
96
default: true,
97
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
98
markdownDescription: localize('filteredTypes.namespace', "When enabled, Outline shows `namespace`-symbols.")
99
},
100
'outline.showPackages': {
101
type: 'boolean',
102
default: true,
103
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
104
markdownDescription: localize('filteredTypes.package', "When enabled, Outline shows `package`-symbols.")
105
},
106
'outline.showClasses': {
107
type: 'boolean',
108
default: true,
109
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
110
markdownDescription: localize('filteredTypes.class', "When enabled, Outline shows `class`-symbols.")
111
},
112
'outline.showMethods': {
113
type: 'boolean',
114
default: true,
115
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
116
markdownDescription: localize('filteredTypes.method', "When enabled, Outline shows `method`-symbols.")
117
},
118
'outline.showProperties': {
119
type: 'boolean',
120
default: true,
121
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
122
markdownDescription: localize('filteredTypes.property', "When enabled, Outline shows `property`-symbols.")
123
},
124
'outline.showFields': {
125
type: 'boolean',
126
default: true,
127
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
128
markdownDescription: localize('filteredTypes.field', "When enabled, Outline shows `field`-symbols.")
129
},
130
'outline.showConstructors': {
131
type: 'boolean',
132
default: true,
133
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
134
markdownDescription: localize('filteredTypes.constructor', "When enabled, Outline shows `constructor`-symbols.")
135
},
136
'outline.showEnums': {
137
type: 'boolean',
138
default: true,
139
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
140
markdownDescription: localize('filteredTypes.enum', "When enabled, Outline shows `enum`-symbols.")
141
},
142
'outline.showInterfaces': {
143
type: 'boolean',
144
default: true,
145
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
146
markdownDescription: localize('filteredTypes.interface', "When enabled, Outline shows `interface`-symbols.")
147
},
148
'outline.showFunctions': {
149
type: 'boolean',
150
default: true,
151
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
152
markdownDescription: localize('filteredTypes.function', "When enabled, Outline shows `function`-symbols.")
153
},
154
'outline.showVariables': {
155
type: 'boolean',
156
default: true,
157
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
158
markdownDescription: localize('filteredTypes.variable', "When enabled, Outline shows `variable`-symbols.")
159
},
160
'outline.showConstants': {
161
type: 'boolean',
162
default: true,
163
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
164
markdownDescription: localize('filteredTypes.constant', "When enabled, Outline shows `constant`-symbols.")
165
},
166
'outline.showStrings': {
167
type: 'boolean',
168
default: true,
169
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
170
markdownDescription: localize('filteredTypes.string', "When enabled, Outline shows `string`-symbols.")
171
},
172
'outline.showNumbers': {
173
type: 'boolean',
174
default: true,
175
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
176
markdownDescription: localize('filteredTypes.number', "When enabled, Outline shows `number`-symbols.")
177
},
178
'outline.showBooleans': {
179
type: 'boolean',
180
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
181
default: true,
182
markdownDescription: localize('filteredTypes.boolean', "When enabled, Outline shows `boolean`-symbols.")
183
},
184
'outline.showArrays': {
185
type: 'boolean',
186
default: true,
187
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
188
markdownDescription: localize('filteredTypes.array', "When enabled, Outline shows `array`-symbols.")
189
},
190
'outline.showObjects': {
191
type: 'boolean',
192
default: true,
193
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
194
markdownDescription: localize('filteredTypes.object', "When enabled, Outline shows `object`-symbols.")
195
},
196
'outline.showKeys': {
197
type: 'boolean',
198
default: true,
199
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
200
markdownDescription: localize('filteredTypes.key', "When enabled, Outline shows `key`-symbols.")
201
},
202
'outline.showNull': {
203
type: 'boolean',
204
default: true,
205
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
206
markdownDescription: localize('filteredTypes.null', "When enabled, Outline shows `null`-symbols.")
207
},
208
'outline.showEnumMembers': {
209
type: 'boolean',
210
default: true,
211
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
212
markdownDescription: localize('filteredTypes.enumMember', "When enabled, Outline shows `enumMember`-symbols.")
213
},
214
'outline.showStructs': {
215
type: 'boolean',
216
default: true,
217
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
218
markdownDescription: localize('filteredTypes.struct', "When enabled, Outline shows `struct`-symbols.")
219
},
220
'outline.showEvents': {
221
type: 'boolean',
222
default: true,
223
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
224
markdownDescription: localize('filteredTypes.event', "When enabled, Outline shows `event`-symbols.")
225
},
226
'outline.showOperators': {
227
type: 'boolean',
228
default: true,
229
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
230
markdownDescription: localize('filteredTypes.operator', "When enabled, Outline shows `operator`-symbols.")
231
},
232
'outline.showTypeParameters': {
233
type: 'boolean',
234
default: true,
235
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
236
markdownDescription: localize('filteredTypes.typeParameter', "When enabled, Outline shows `typeParameter`-symbols.")
237
}
238
}
239
});
240
241