You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/references/contribution-points.md
+26-27Lines changed: 26 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -141,7 +141,7 @@ See the [Commands Extension Guide](https://code.visualstudio.com/api/extension-g
141
141
142
142
## contributes.configuration
143
143
144
-
Contribute configuration keys that will be exposed to the user. The user will be able to set these configuration options as User Settings or as Workspace Settings, either by using the Settings editor or by editing the JSON settings file directly.
144
+
Contribute configuration keys that will be exposed to the user. The user will be able to set these configuration options in the Settings editor or by editing a settings.json file directly.
145
145
146
146
This section can either be a single object, representing a single category of settings, or an array of objects, representing multiple categories of settings. If there are multiple categories of settings, the Settings editor will show a submenu in the table of contents for that extension, and the title keys will be used for the submenu entry names.
147
147
@@ -179,7 +179,7 @@ Your configuration entry is used both to provide intellisense when editing your
179
179
180
180

181
181
182
-
**title**
182
+
#### title
183
183
184
184
The `title` 1️⃣️ of a category is the heading used for that category.
185
185
@@ -200,7 +200,7 @@ For both the `title` and `displayName` fields, words like "Extension", "Configur
Your `description` 3️⃣ appears after the title and before the input field, except for booleans, where the description is used as the label for the checkbox. 6️⃣
240
240
@@ -258,7 +258,7 @@ If you use `markdownDescription` instead of `description`, your setting descript
258
258
259
259
For `markdownDescription`, in order to add newlines or multiple paragraphs, use the string `\n\n` to separate the paragraphs instead of just `\n`.
260
260
261
-
**type**
261
+
#### type
262
262
263
263
Entries of type `number` 4️⃣ , `string` 5️⃣ , `boolean` 6️⃣ can be edited directly in the settings UI.
264
264
@@ -289,7 +289,7 @@ Some `object` and `array` type settings will be rendered in the settings UI. Sim
289
289
290
290
If an `object` or `array` type setting can also contain other types like nested objects, arrays, or null, then the value won't be rendered in the settings UI and can only be modified by editing the JSON directly. Users will see a link to **Edit in settings.json** as shown in the screenshot above. 8️⃣
291
291
292
-
**order**
292
+
#### order
293
293
294
294
Both categories and the settings within those categories can take an integer `order` type property, which gives a reference to how they should be sorted relative to other categories and/or settings.
295
295
@@ -299,34 +299,33 @@ If two settings within the same category have `order` properties, the setting wi
299
299
300
300
If two categories have the same `order` property value, or if two settings within the same category have the same `order` property value, then they will be sorted in increasing alphabetical order within the settings UI.
If you provide an array of items under the `enum` 7️⃣ property, the settings UI will render a dropdown menu.
304
+
If you provide an array of items under the `enum` 7️⃣ property, the settings UI will render a dropdown menu of those items.
305
305
306
-

306
+
You can also provide an `enumDescriptions` property, an array of strings of the same length as the `enum` property. The `enumDescriptions` property provides a description in the settings UI at the bottom of the dropdown menu corresponding to each `enum` item. \
307
+
You can also use `markdownEnumDescriptions` instead of `enumDescriptions`, and your descriptions will be parsed as Markdown. \
308
+
To customize the dropdown option names in the settings UI, you can use `enumItemLabels`.
307
309
308
-
You can also provide an `enumDescriptions` property, which provides descriptive text rendered at the bottom of the dropdown:
310
+
Example:
309
311
310
312
```json
311
313
{
312
-
"gitMagic.blame.heatMap.location": {
314
+
"settingsEditorTestExtension.enumSetting": {
313
315
"type": "string",
314
-
"default": "right",
315
-
"enum": ["left", "right"],
316
-
"enumDescriptions": [
317
-
"Adds a heatmap indicator on the left edge of the gutter blame annotations",
318
-
"Adds a heatmap indicator on the right edge of the gutter blame annotations"
319
-
]
316
+
"enum": ["first", "second", "third"],
317
+
"enumDescriptions": ["The first enum", "The second enum", "The third enum"],
318
+
"markdownEnumDescriptions": ["The *first* enum", "The *second* enum", "The *third* enum"],
319
+
"enumItemLabels": ["1st", "2nd", "3rd"],
320
+
"default": "first",
321
+
"description": "Example setting with an enum"
320
322
}
321
323
}
322
324
```
323
325
324
-
You can also use `markdownEnumDescriptions`, and your descriptions will be rendered as Markdown.
325
-
326
-
To customize the dropdown options, you can use `enumItemLabels`. The `workbench.iconTheme` setting uses both `enumDescriptions` and `enumItemLabels`. In the screenshot below, the hovered option has the item label "None", with enum description "No file icons" and enum value `null`.
327
-

326
+

If you set `deprecationMessage`, or `markdownDeprecationMessage`, the setting will get a warning underline with your specified message. Also, the setting will be hidden from the settings UI unless it is configured by the user. If you set `markdownDeprecationMessage`, the markdown will not be rendered in the setting hover or the problems view. If you set both properties, `deprecationMessage` will be shown in the hover and the problems view, and `markdownDeprecationMessage` will be rendered as Markdown in the settings UI.
332
331
@@ -343,7 +342,7 @@ Example:
343
342
}
344
343
```
345
344
346
-
**Other JSON Schema properties**
345
+
#### Other JSON Schema properties
347
346
348
347
You can use any of the validation JSON Schema properties to describe other constraints on configuration values:
349
348
@@ -357,15 +356,15 @@ You can use any of the validation JSON Schema properties to describe other const
357
356
-`maxItems`, `minItems` for restricting array length
358
357
-`editPresentation` for controlling whether a single-line inputbox or multi-line textarea is rendered for the string setting in the Settings editor
359
358
360
-
**Unsupported JSON Schema properties**
359
+
#### Unsupported JSON Schema properties
361
360
362
361
Not supported in the configuration section are:
363
362
364
363
-`$ref` and `definition`: The configuration schemas needs to be self-contained and cannot make assumptions how the aggregated settings JSON schema document looks like.
365
364
366
365
For more details on these and other features, see the [JSON Schema Reference](https://json-schema.org/overview/what-is-jsonschema).
367
366
368
-
**scope**
367
+
#### scope
369
368
370
369
A configuration setting can have one of the following possible scopes:
371
370
@@ -423,7 +422,7 @@ Below are example configuration scopes from the built-in Git extension:
423
422
424
423
You can see that `git.alwaysSignOff` has `resource` scope and can be set per user, workspace, or folder, while the ignored repositories list with `window` scope applies more globally for the VS Code window or workspace (which might be multi-root).
425
424
426
-
**Linking to settings**
425
+
#### Linking to settings
427
426
428
427
You can insert a link to another setting, which will be rendered as a clickable link in the settings UI, by using this special syntax in the markdown-type properties: ``` `#target.setting.id#` ```. This will work in `markdownDescription`, `markdownEnumDescriptions`, and `markdownDeprecationMessage`. Example:
0 commit comments