outline.contribution.ts 8.5 KB
Newer Older
J
Johannes Rieken 已提交
1 2 3 4 5 6
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { localize } from 'vs/nls';
S
SteVen Batten 已提交
7
import { IViewsRegistry, IViewDescriptor, Extensions as ViewExtensions } from 'vs/workbench/common/views';
8
import { OutlinePane } from './outlinePane';
9
import { Registry } from 'vs/platform/registry/common/platform';
10
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
11
import { OutlineConfigKeys, OutlineViewId } from 'vs/editor/contrib/documentSymbols/outline';
12
import { VIEW_CONTAINER } from 'vs/workbench/contrib/files/browser/explorerViewlet';
S
Sandeep Somavarapu 已提交
13
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
14 15
import { Codicon } from 'vs/base/common/codicons';
import { registerIcon } from 'vs/platform/theme/common/iconRegistry';
J
Johannes Rieken 已提交
16

S
SteVen Batten 已提交
17

18 19
const outlineViewIcon = registerIcon('outline-view-icon', Codicon.symbolClass, localize('outlineViewIcon', 'View icon of the outline view.'));

20
const _outlineDesc = <IViewDescriptor>{
21
	id: OutlineViewId,
J
Johannes Rieken 已提交
22
	name: localize('name', "Outline"),
23
	containerIcon: outlineViewIcon,
S
Sandeep Somavarapu 已提交
24
	ctorDescriptor: new SyncDescriptor(OutlinePane),
25
	canToggleVisibility: true,
S
SteVen Batten 已提交
26
	canMoveView: true,
J
Johannes Rieken 已提交
27
	hideByDefault: false,
J
Johannes Rieken 已提交
28
	collapsed: true,
J
Johannes Rieken 已提交
29
	order: 2,
S
Sandeep Somavarapu 已提交
30 31
	weight: 30,
	focusCommand: { id: 'outline.focus' }
J
Johannes Rieken 已提交
32 33
};

34
Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([_outlineDesc], VIEW_CONTAINER);
J
Johannes Rieken 已提交
35

36 37 38
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
	'id': 'outline',
	'order': 117,
G
Greg Van Liew 已提交
39
	'title': localize('outlineConfigurationTitle', "Outline"),
40 41
	'type': 'object',
	'properties': {
42 43 44 45 46
		[OutlineConfigKeys.icons]: {
			'description': localize('outline.showIcons', "Render Outline Elements with Icons."),
			'type': 'boolean',
			'default': true
		},
47 48 49 50 51 52 53 54 55 56 57 58
		'outline.symbolSortOrder': {
			description: localize('symbolSortOrder', "Controls how symbols are sorted in the outline view."),
			type: 'string',
			default: 'position',
			// scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
			enum: ['position', 'name', 'type'],
			enumDescriptions: [
				localize('symbolSortOrder.position', "Show symbol outline in file position order."),
				localize('symbolSortOrder.name', "Show symbol outline in alphabetical order."),
				localize('symbolSortOrder.type', "Show symbol outline in symbol type order."),
			]
		},
59 60 61 62
		[OutlineConfigKeys.problemsEnabled]: {
			'description': localize('outline.showProblem', "Show Errors & Warnings on Outline Elements."),
			'type': 'boolean',
			'default': true
63
		},
64 65 66 67
		[OutlineConfigKeys.problemsColors]: {
			'description': localize('outline.problem.colors', "Use colors for Errors & Warnings."),
			'type': 'boolean',
			'default': true
68
		},
69 70 71 72
		[OutlineConfigKeys.problemsBadges]: {
			'description': localize('outline.problems.badges', "Use badges for Errors & Warnings."),
			'type': 'boolean',
			'default': true
73
		},
74
		'outline.showFiles': {
75
			type: 'boolean',
S
Sandeep Somavarapu 已提交
76
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
77
			default: true,
J
Johannes Rieken 已提交
78
			markdownDescription: localize('filteredTypes.file', "When enabled outline shows `file`-symbols.")
79
		},
80
		'outline.showModules': {
81
			type: 'boolean',
S
Sandeep Somavarapu 已提交
82
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
83
			default: true,
J
Johannes Rieken 已提交
84
			markdownDescription: localize('filteredTypes.module', "When enabled outline shows `module`-symbols.")
85
		},
86
		'outline.showNamespaces': {
87 88
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
89
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
90
			markdownDescription: localize('filteredTypes.namespace', "When enabled outline shows `namespace`-symbols.")
91
		},
92
		'outline.showPackages': {
93 94
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
95
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
96
			markdownDescription: localize('filteredTypes.package', "When enabled outline shows `package`-symbols.")
97
		},
98
		'outline.showClasses': {
99 100
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
101
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
102
			markdownDescription: localize('filteredTypes.class', "When enabled outline shows `class`-symbols.")
103
		},
104
		'outline.showMethods': {
105 106
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
107
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
108
			markdownDescription: localize('filteredTypes.method', "When enabled outline shows `method`-symbols.")
109
		},
110
		'outline.showProperties': {
111 112
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
113
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
114
			markdownDescription: localize('filteredTypes.property', "When enabled outline shows `property`-symbols.")
115
		},
116
		'outline.showFields': {
117 118
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
119
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
120
			markdownDescription: localize('filteredTypes.field', "When enabled outline shows `field`-symbols.")
121
		},
122
		'outline.showConstructors': {
123 124
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
125
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
126
			markdownDescription: localize('filteredTypes.constructor', "When enabled outline shows `constructor`-symbols.")
127
		},
128
		'outline.showEnums': {
129 130
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
131
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
132
			markdownDescription: localize('filteredTypes.enum', "When enabled outline shows `enum`-symbols.")
133
		},
134
		'outline.showInterfaces': {
135 136
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
137
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
138
			markdownDescription: localize('filteredTypes.interface', "When enabled outline shows `interface`-symbols.")
139
		},
140
		'outline.showFunctions': {
141 142
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
143
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
144
			markdownDescription: localize('filteredTypes.function', "When enabled outline shows `function`-symbols.")
145
		},
146
		'outline.showVariables': {
147 148
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
149
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
150
			markdownDescription: localize('filteredTypes.variable', "When enabled outline shows `variable`-symbols.")
151
		},
152
		'outline.showConstants': {
153 154
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
155
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
156
			markdownDescription: localize('filteredTypes.constant', "When enabled outline shows `constant`-symbols.")
157
		},
158
		'outline.showStrings': {
159 160
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
161
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
162
			markdownDescription: localize('filteredTypes.string', "When enabled outline shows `string`-symbols.")
163
		},
164
		'outline.showNumbers': {
165 166
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
167
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
168
			markdownDescription: localize('filteredTypes.number', "When enabled outline shows `number`-symbols.")
169
		},
170
		'outline.showBooleans': {
171
			type: 'boolean',
S
Sandeep Somavarapu 已提交
172
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
173
			default: true,
J
Johannes Rieken 已提交
174
			markdownDescription: localize('filteredTypes.boolean', "When enabled outline shows `boolean`-symbols.")
175
		},
176
		'outline.showArrays': {
177 178
			type: 'boolean',
			default: true,
S
Sandeep Somavarapu 已提交
179
			scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
J
Johannes Rieken 已提交
180
			markdownDescription: localize('filteredTypes.array', "When enabled outline shows `array`-symbols.")
181
		},
182
		'outline.showObjects': {
183 184
			type: 'boolean',
			default: true,
J
Johannes Rieken 已提交
185
			markdownDescription: localize('filteredTypes.object', "When enabled outline shows `object`-symbols.")
186
		},
187
		'outline.showKeys': {
188 189
			type: 'boolean',
			default: true,
J
Johannes Rieken 已提交
190
			markdownDescription: localize('filteredTypes.key', "When enabled outline shows `key`-symbols.")
191
		},
192
		'outline.showNull': {
193 194
			type: 'boolean',
			default: true,
J
Johannes Rieken 已提交
195
			markdownDescription: localize('filteredTypes.null', "When enabled outline shows `null`-symbols.")
196
		},
197
		'outline.showEnumMembers': {
198 199
			type: 'boolean',
			default: true,
J
Johannes Rieken 已提交
200
			markdownDescription: localize('filteredTypes.enumMember', "When enabled outline shows `enumMember`-symbols.")
201
		},
202
		'outline.showStructs': {
203 204
			type: 'boolean',
			default: true,
J
Johannes Rieken 已提交
205
			markdownDescription: localize('filteredTypes.struct', "When enabled outline shows `struct`-symbols.")
206
		},
207
		'outline.showEvents': {
208 209
			type: 'boolean',
			default: true,
J
Johannes Rieken 已提交
210
			markdownDescription: localize('filteredTypes.event', "When enabled outline shows `event`-symbols.")
211
		},
212
		'outline.showOperators': {
213 214
			type: 'boolean',
			default: true,
J
Johannes Rieken 已提交
215
			markdownDescription: localize('filteredTypes.operator', "When enabled outline shows `operator`-symbols.")
216
		},
217
		'outline.showTypeParameters': {
218 219
			type: 'boolean',
			default: true,
J
Johannes Rieken 已提交
220
			markdownDescription: localize('filteredTypes.typeParameter', "When enabled outline shows `typeParameter`-symbols.")
221 222 223
		}
	}
});