155 |
156 | {% js %}
157 | // Add schema definitions for this JSON editor field
158 | var jsonSchemaUri = 'https://craft-code-editor.com/{{ "monacoEditorOptions"|namespaceInputId }}';
159 | var jsonSchema = {
160 | uri: jsonSchemaUri,
161 | fileMatch: [jsonSchemaUri],
162 | schema: {{ optionsSchema | raw }}
163 | }
164 | // configure the JSON language support with schemas and schema associations
165 | monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
166 | validate: true,
167 | schemas: [jsonSchema]
168 | });
169 | {% endjs %}
170 |
--------------------------------------------------------------------------------
/docs/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Code Field plugin for Craft CMS
3 | sidebar: false
4 |
5 | description: Documentation for the Code Field plugin. The Code Field plugin provides a Code Field that has a full-featured code editor with syntax highlighting & autocomplete
6 | ---
7 | [](https://scrutinizer-ci.com/g/nystudio107/craft-code-field/?branch=v5) [](https://scrutinizer-ci.com/g/nystudio107/craft-code-field/?branch=v5) [](https://scrutinizer-ci.com/g/nystudio107/craft-code-field/build-status/v5) [](https://scrutinizer-ci.com/code-intelligence)
8 |
9 | # Code Field plugin for Craft CMS
10 |
11 | Provides a Code Field that has a full-featured code editor with syntax highlighting & autocomplete
12 |
13 | 
14 |
15 | ## Requirements
16 |
17 | This plugin requires Craft CMS 5.0.0 or later
18 |
19 | ## Installation
20 |
21 | To install the plugin, follow these instructions.
22 |
23 | 1. Open your terminal and go to your Craft project:
24 |
25 | cd /path/to/project
26 |
27 | 2. Then tell Composer to load the plugin:
28 |
29 | composer require nystudio107/craft-code-field
30 |
31 | 3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Code Field.
32 |
33 | ## Code Field Overview
34 |
35 | Code Field is a Craft CMS field type that uses the [craft-code-editor](https://github.com/nystudio107/craft-code-editor) package to provide a modern code editor for content authors.
36 |
37 | Code Field uses the [Monaco editor](https://microsoft.github.io/monaco-editor/) that leverages the same core code that the popular [VS Code](https://code.visualstudio.com/) editor uses.
38 |
39 | That means it provides code highlighting, syntax checking, and autocompletion for over 80 languages.
40 |
41 | 
42 |
43 | It also has light, dark, and high contrast themes that can be chosen on a per-field basis.
44 |
45 | 
46 |
47 | It also sports as a variety of editor options such as font size, line numbers, code folding, and more.
48 |
49 | 
50 |
51 | ## Configuring Code Field
52 |
53 | Once the Code Editor plugin is installed, it provides a **Code** field type that you can create like any other Craft CMS field.
54 |
55 | You can configure each field with its own discrete settings:
56 |
57 | 
58 |
59 | * **Code Field Theme** - The theme to use for the Code Field editor. It can be either Auto, Visual Studio Light, Visual Studio Dark, or High Contrast Dark. **Auto** will set the light/dark theme based on browser light/dark mode. **N.B.:** The Monaco editor [allows only one theme per page](https://github.com/microsoft/monaco-editor/issues/338) so you can’t have different editor instances using different themes.
60 | * **Code Field Default Language** - The language to use for the Code Field editor. This can optionally be changed by content authors while using the field (see below)
61 | * **Font Size** - The font size to use for the Code Field editor
62 | * **Single Line Code Field** - Whether the editor should behave like a Craft field that can be tabbed between, and displays as a single line, with no line breaks.
63 | * **Line Numbers** - Whether line numbers should be displayed in the Code Field editor.
64 | * **Code Folding** - Whether code folding controls should be displayed in the Code Field editor margins.
65 | * **Placeholder Text** - The text that will be shown if the Code Field is empty.
66 | * **Show Language Dropdown with Field** - Whether content authors should have a Language dropdown menu available to them under the Code Field editor when editing an entry.
67 | * **Default Value** - The default value the Code Field will be populated with.
68 |
69 | ### Available Languages
70 |
71 | Clicking on **Available Languages** discloses a list of over 80 languages:
72 |
73 | 
74 |
75 | Check the languages that you want to appear in the **Language** dropdown menu that is optionally displayed under the Code Field editor when editing an entry.
76 |
77 | This lets you limit the languages available to content authors to a subset of all of the available languages.
78 |
79 | ### Advanced
80 |
81 | Clicking on **Advanced** discloses a **Monaco Editor Settings Override** field:
82 |
83 | 
84 |
85 | This allows you to override any of the Monaco [EditorOptions](https://microsoft.github.io/monaco-editor/typedoc/enums/editor.EditorOption.html) settings via a JSON blob configuration.
86 |
87 | Using this, you can control every aspect of the Code Field editor.
88 |
89 | This field uses a Code Editor field itself, with a JSON schema for the Monaco [`IEditorOptions`](https://microsoft.github.io/monaco-editor/typedoc/interfaces/editor.IEditorOptions.html), so you get autocomplete and hovers here, too!
90 |
91 | ## Converting Existing Fields
92 |
93 | You can convert existing Craft CMS [Plain Text](https://craftcms.com/docs/4.x/plain-text-fields.html) fields, [Code Mirror](https://plugins.craftcms.com/code-mirror) fields, [Simple Text](https://plugins.craftcms.com/simple-text) fields, or other text/code fields to Code Field fields just by changing the field type to **Code**.
94 |
95 | All of your existing content will be left intact after converting them over.
96 |
97 | ## Using Code Field
98 |
99 | Use the Code Field as you would any other Craft CMS field.
100 |
101 | To output the contents of the field on the frontend, simply do:
102 |
103 | ```twig
104 | {{ entry.someCode.value | raw }}
105 | ```
106 |
107 | To know the language or other settings for the Code Field editor, you can get that as well:
108 |
109 | ```twig
110 | {# Do whatever you need to do for this language #}
111 | {% if entry.someCode.language == "javascript" %}
112 |
116 | ```
117 |
118 | This will not result in any formatting of syntax highlighting of the code on the frontend; that’s up to you to do as you see fit (using [Shiki](https://shiki.matsu.io/), [highlight.js](https://highlightjs.org/), [Prism](https://prismjs.com/), etc.).
119 |
120 | ### Rendering with Syntax Highlighting
121 |
122 | However, you can also use the [craft-code-editor](https://github.com/nystudio107/craft-code-editor#in-frontend-templates) Twig macros directly to display the Code Field editor on the frontend.
123 |
124 | The following `monacoOptions` allow you to make the field read-only (though the user can still interact with the code):
125 | ```json
126 | {
127 | "domReadOnly": true,
128 | "readOnly": true
129 | }
130 | ```
131 |
132 | So putting it together, if your Code Field field handle is `someCode`, this would allow you to display it on the frontend with full syntax highlighting, etc.:
133 |
134 | ```twig
135 | {% import "codeeditor/codeEditor" as codeEditor %}
136 |
137 |
138 |
139 |
140 | {{ codeEditor.includeJs("myCodeEditor", "Frontend Editor", {
141 | language: entry.someCode.language,
142 | theme: "auto",
143 | "domReadOnly": true,
144 | "readOnly": true
145 | }) }}
146 | ```
147 |
148 | ...and it will look something like this:
149 |
150 | 
151 |
152 | If you want Twig & Craft API autocompletes to work on the frontend, you’ll need to enable the [`allowFrontendAccess`](https://github.com/nystudio107/craft-code-editor#in-frontend-templates) setting in `craft-code-editor`, but this isn’t necessary if the code is just for display purposes.
153 |
154 | ### Rendering Twig Code Output
155 |
156 | If you are storing Twig code, you can actually render that on the frontend using [renderObjectTemplate](https://craftcms.com/docs/4.x/dev/functions.html#renderobjecttemplate) if you like:
157 |
158 | ```twig
159 | {{ renderObjectTemplate(entry.someCode.value, entry) }}
160 | ```
161 |
162 | ## Advanced Usage
163 |
164 | ### GraphQL
165 |
166 | Code Field supports GraphQL, here’s an example query:
167 |
168 | ```GraphQL
169 | {
170 | entries(section: "blog", limit:1) {
171 | ...on blog_blog_Entry {
172 | title,
173 | someCode {
174 | language,
175 | value
176 | }
177 | }
178 | }
179 | }
180 | ```
181 |
182 | In this example, `someCode` is the Code Field field handle. The schema supports the following parameters:
183 |
184 | * **`language`** - The language of the Code Field
185 | * **`value`** - The data entered into the Code Field
186 |
187 | Here’s an example of the data returned from the above query:
188 |
189 | ```json
190 | {
191 | "data": {
192 | "entries": [
193 | {
194 | "title": "My first blog",
195 | "someCode": {
196 | "language": "typescript",
197 | "value": "function createQuote(quote, callback){ \r\n var myQuote = \"Like I always say, \" + quote;\r\n callback(myQuote); // 2\r\n}\r\n\r\nfunction logQuote(quote: string){\r\n console.log(quote);\r\n}\r\n\r\ncreateQuote(\"eat your vegetables!\", logQuote); // 1"
198 | }
199 | }
200 | ]
201 | }
202 | }
203 | ```
204 |
205 | ## Code Field Roadmap
206 |
207 | Some things to do, and ideas for potential features:
208 |
209 | * Add a default value for the field in Field Settings
210 | * Provide support for additional third-party themes
211 | * Add a setting to turn off the display of the language icon
212 |
213 | Brought to you by [nystudio107](https://nystudio107.com)
214 |
--------------------------------------------------------------------------------
/src/fields/Code.php:
--------------------------------------------------------------------------------
1 | $this->defaultValue,
170 | 'language' => $this->language,
171 | ];
172 | // Handle incoming values potentially being JSON or an array
173 | if (!empty($value)) {
174 | // Handle JSON-encoded values coming in
175 | if (is_string($value)) {
176 | $jsonValue = Json::decodeIfJson($value);
177 | // If this is still a string (meaning it's not valid JSON), treat it as the value
178 | if (is_string($jsonValue)) {
179 | $config['value'] = $jsonValue;
180 | }
181 | if (is_array($jsonValue)) {
182 | // Check to make sure the array returned is an encoded `CodeData` config, with exactly
183 | // the same expected key/value pairs
184 | if (!array_diff_key($config, $jsonValue) && !array_diff_key($jsonValue, $config)) {
185 | $value = $jsonValue;
186 | } else {
187 | // Otherwise treat it as JSON data
188 | $value = [
189 | 'value' => $value,
190 | 'language' => 'json',
191 | ];
192 | }
193 | }
194 | }
195 | if (is_array($value)) {
196 | $config = array_merge($config, array_filter($value));
197 | }
198 | }
199 | // Create and validate the model
200 | $codeData = new CodeData($config);
201 | if (!$codeData->validate()) {
202 | Craft::error(
203 | Craft::t('codefield', 'CodeData failed validation: ')
204 | . print_r($codeData->getErrors(), true),
205 | __METHOD__
206 | );
207 | }
208 |
209 | return $codeData;
210 | }
211 |
212 | /**
213 | * @inheritdoc
214 | */
215 | public function getSettingsHtml(): ?string
216 | {
217 | $monacoLanguages = require(__DIR__ . '/MonacoLanguages.php');
218 | $schemaFilePath = Craft::getAlias('@nystudio107/codefield/resources/IEditorOptionsSchema.json');
219 | $optionsSchema = @file_get_contents($schemaFilePath) ?: '';
220 | // Render the settings template
221 | return Craft::$app->getView()->renderTemplate(
222 | 'codefield/_components/fields/Code_settings',
223 | [
224 | 'field' => $this,
225 | 'monacoLanguages' => $monacoLanguages,
226 | 'optionsSchema' => $optionsSchema,
227 | ]
228 | );
229 | }
230 |
231 | /**
232 | * @inheritdoc
233 | */
234 | public function getInputHtml($value, ElementInterface $element = null): string
235 | {
236 | $twigVariables = $this->getFieldRenderVariables($value, $element, true);
237 | // Render the input template
238 | return Craft::$app->getView()->renderTemplate(
239 | 'codefield/_components/fields/Code_input',
240 | $twigVariables
241 | );
242 | }
243 |
244 | /**
245 | * @inheritdoc
246 | */
247 | public function getStaticHtml(mixed $value, ElementInterface $element): string
248 | {
249 | $twigVariables = $this->getFieldRenderVariables($value, $element, false);
250 | // Render the input template
251 | return Craft::$app->getView()->renderTemplate(
252 | 'codefield/_components/fields/Code_input',
253 | $twigVariables
254 | );
255 | }
256 |
257 | /**
258 | * @inheritdoc
259 | */
260 | public function getContentGqlType(): Type|array
261 | {
262 | $typeArray = CodeDataGenerator::generateTypes($this);
263 |
264 | return [
265 | 'name' => $this->handle,
266 | 'description' => 'Code Editor field',
267 | 'type' => array_shift($typeArray),
268 | ];
269 | }
270 |
271 | /**
272 | * @inheritdoc
273 | */
274 | public function rules(): array
275 | {
276 | $rules = parent::rules();
277 | return array_merge($rules, [
278 | ['theme', 'in', 'range' => ['auto', 'vs', 'vs-dark', 'hc-black']],
279 | ['theme', 'default', 'value' => 'auto'],
280 | ['language', 'string'],
281 | ['language', 'default', 'value' => 'javascript'],
282 | [['singleLineEditor', 'showLanguageDropdown', 'lineNumbers', 'codeFolding'], 'boolean'],
283 | ['placeholder', 'string'],
284 | ['placeholder', 'default', 'value' => ''],
285 | ['fontSize', 'integer'],
286 | ['fontSize', 'default', 'value' => 14],
287 | ['availableLanguages', ArrayValidator::class],
288 | ['monacoEditorOptions', JsonValidator::class],
289 | ]);
290 | }
291 |
292 | // Protected Methods
293 | // =========================================================================
294 |
295 | /**
296 | * Return the Twig variables for rendering the field
297 | *
298 | * @param $value
299 | * @param ElementInterface $element
300 | * @param bool $enabled Whether the field is enabled or not
301 | * @return array[]
302 | */
303 | protected function getFieldRenderVariables($value, ElementInterface $element, bool $enabled): array
304 | {
305 | // Get our id and namespace
306 | $id = Html::id($this->handle);
307 | $namespacedId = Craft::$app->getView()->namespaceInputId($id);
308 |
309 | // Extract just the languages that have been selected for display
310 | $displayLanguages = [];
311 | if ($this->showLanguageDropdown) {
312 | $monacoLanguages = require(__DIR__ . '/MonacoLanguages.php');
313 | $decomposedLanguages = array_column($monacoLanguages, 'label', 'value');
314 | $displayLanguages = array_intersect_key($decomposedLanguages, array_flip($this->availableLanguages));
315 | // Handle "all" checkbox
316 | if ($this->availableLanguages[0] === '*') {
317 | $displayLanguages = $decomposedLanguages;
318 | }
319 | $displayLanguages = array_map(static function($k, $v) {
320 | return ['value' => $k, 'label' => $v];
321 | }, array_keys($displayLanguages), array_values($displayLanguages));
322 | }
323 | $monacoOptionsOverride = Json::decodeIfJson($this->monacoEditorOptions);
324 | if ($monacoOptionsOverride === null || is_string($monacoOptionsOverride)) {
325 | $monacoOptionsOverride = [];
326 | }
327 | // Disable the Monaco editor
328 | if (!$enabled) {
329 | $monacoOptionsOverride['domReadOnly'] = true;
330 | $monacoOptionsOverride['readOnly'] = true;
331 | }
332 | return [
333 | 'name' => $this->handle,
334 | 'value' => $value,
335 | 'field' => $this,
336 | 'orientation' => $this->getOrientation($element),
337 | 'id' => $id,
338 | 'namespacedId' => $namespacedId,
339 | 'displayLanguages' => $displayLanguages,
340 | 'monacoOptionsOverride' => $monacoOptionsOverride,
341 | ];
342 | }
343 | }
344 |
--------------------------------------------------------------------------------
/src/resources/IEditorOptionsSchema.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "object",
3 | "properties": {
4 | "acceptSuggestionOnCommitCharacter": {
5 | "default": true,
6 | "description": "Accept suggestions on provider defined characters. Defaults to true.",
7 | "type": "boolean"
8 | },
9 | "acceptSuggestionOnEnter": {
10 | "default": "on",
11 | "description": "Accept suggestions on ENTER. Defaults to 'on'.",
12 | "enum": [
13 | "on",
14 | "off",
15 | "smart"
16 | ],
17 | "type": "string"
18 | },
19 | "accessibilityPageSize": {
20 | "default": 3,
21 | "description": "Controls the number of lines in the editor that can be read out by a screen reader",
22 | "type": "number"
23 | },
24 | "accessibilitySupport": {
25 | "default": "auto",
26 | "description": "Configure the editor's accessibility support. Defaults to 'auto'. It is best to leave this to 'auto'.",
27 | "type": "string"
28 | },
29 | "ariaLabel": {
30 | "default": "",
31 | "description": "The aria label for the editor's textarea (when it is focused).",
32 | "type": "string"
33 | },
34 | "autoClosingBrackets": {
35 | "$ref": "#/$defs/EditorAutoClosingStrategy"
36 | },
37 | "autoClosingDelete": {
38 | "$ref": "#/$defs/EditorAutoClosingEditStrategy"
39 | },
40 | "autoClosingOvertype": {
41 | "$ref": "#/$defs/EditorAutoClosingEditStrategy"
42 | },
43 | "autoClosingQuotes": {
44 | "$ref": "#/$defs/EditorAutoClosingEditStrategy"
45 | },
46 | "autoIndent": {
47 | "default": "advanced",
48 | "description": "Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines. Defaults to advanced.",
49 | "enum": [
50 | "none",
51 | "advanced",
52 | "full",
53 | "brackets",
54 | "keep"
55 | ],
56 | "type": "string"
57 | },
58 | "autoSurround": {
59 | "$ref": "#/$defs/EditorAutoSurroundStrategy"
60 | },
61 | "automaticLayout": {
62 | "default": false,
63 | "description": "Enable that the editor will install a ResizeObserver to check if its container dom node size has changed. Defaults to false.",
64 | "type": "boolean"
65 | },
66 | "bracketPairColorization": {
67 | "$ref": "#/$defs/IBracketPairColorizationOptions"
68 | },
69 | "codeActionsOnSaveTimeout": {
70 | "default": 0,
71 | "description": "Timeout for running code actions on save.",
72 | "type": "number"
73 | },
74 | "codeLens": {
75 | "default": true,
76 | "description": "Show code lens. Defaults to true.",
77 | "type": "boolean"
78 | },
79 | "codeLensFontFamily": {
80 | "description": "Code lens font family. Defaults to editor font family.",
81 | "type": "string"
82 | },
83 | "codeLensFontSize": {
84 | "description": "Code lens font size. Default to 90% of the editor font size",
85 | "type": "number"
86 | },
87 | "colorDecorators": {
88 | "description": "Enable inline color decorators and color picker rendering.",
89 | "type": "boolean"
90 | },
91 | "colorDecoratorsLimit": {
92 | "description": "Controls the max number of color decorators that can be rendered in an editor at once.",
93 | "type": "number"
94 | },
95 | "columnSelection": {
96 | "default": false,
97 | "description": "Enable that the selection with the mouse and keys is doing column selection. Defaults to false.",
98 | "type": "boolean"
99 | },
100 | "comments": {
101 | "$ref": "#/$defs/IEditorCommentsOptions"
102 | },
103 | "contextmenu": {
104 | "default": true,
105 | "description": "Enable custom contextmenu. Defaults to true.",
106 | "type": "boolean"
107 | },
108 | "copyWithSyntaxHighlighting": {
109 | "description": "Syntax highlighting is copied.",
110 | "type": "boolean"
111 | },
112 | "cursorBlinking": {
113 | "default": "blink",
114 | "description": "Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'. Defaults to 'blink'.",
115 | "enum": [
116 | "blink",
117 | "smooth",
118 | "phase",
119 | "expand",
120 | "solid"
121 | ],
122 | "type": "string"
123 | },
124 | "cursorSmoothCaretAnimation": {
125 | "default": "off",
126 | "description": "Enable smooth caret animation. Defaults to 'off'.",
127 | "enum": [
128 | "on",
129 | "off",
130 | "explicit"
131 | ],
132 | "type": "string"
133 | },
134 | "cursorStyle": {
135 | "default": "line",
136 | "description": "Control the cursor style, either 'block' or 'line'. Defaults to 'line'.",
137 | "enum": [
138 | "line",
139 | "block",
140 | "underline",
141 | "line-thin",
142 | "block-outline",
143 | "underline-thin"
144 | ],
145 | "type": "string"
146 | },
147 | "cursorSurroundingLines": {
148 | "default": 0,
149 | "description": "Controls the minimal number of visible leading and trailing lines surrounding the cursor. Defaults to 0.",
150 | "type": "number"
151 | },
152 | "cursorSurroundingLinesStyle": {
153 | "default": "default",
154 | "description": "Controls when cursorSurroundingLines should be enforced Defaults to default, cursorSurroundingLines is not enforced when cursor position is changed by mouse.",
155 | "enum": [
156 | "default",
157 | "all"
158 | ],
159 | "type": "string"
160 | },
161 | "cursorWidth": {
162 | "description": "Control the width of the cursor when cursorStyle is set to 'line'.",
163 | "type": "number"
164 | },
165 | "definitionLinkOpensInPeek": {
166 | "default": false,
167 | "description": "Controls whether the definition link opens element in the peek widget. Defaults to false.",
168 | "type": "boolean"
169 | },
170 | "disableLayerHinting": {
171 | "default": false,
172 | "description": "Disable the use of transform: translate3d(0px, 0px, 0px) for the editor margin and lines layers. The usage of transform: translate3d(0px, 0px, 0px) acts as a hint for browsers to create an extra layer. Defaults to false.",
173 | "type": "boolean"
174 | },
175 | "disableMonospaceOptimizations": {
176 | "default": false,
177 | "description": "Disable the optimizations for monospace fonts. Defaults to false.",
178 | "type": "boolean"
179 | },
180 | "domReadOnly": {
181 | "default": false,
182 | "description": "Should the textarea used for input use the DOM readonly attribute. Defaults to false.",
183 | "type": "boolean"
184 | },
185 | "dragAndDrop": {
186 | "default": false,
187 | "description": "Controls if the editor should allow to move selections via drag and drop. Defaults to false.",
188 | "type": "boolean"
189 | },
190 | "dropIntoEditor": {
191 | "$ref": "#/$defs/IDropIntoEditorOptions"
192 | },
193 | "emptySelectionClipboard": {
194 | "description": "Copying without a selection copies the current line.",
195 | "type": "boolean"
196 | },
197 | "experimentalWhitespaceRendering": {
198 | "default": "svg",
199 | "description": "Enable experimental whitespace rendering. Defaults to 'svg'.",
200 | "enum": [
201 | "off",
202 | "svg",
203 | "font"
204 | ],
205 | "type": "string"
206 | },
207 | "extraEditorClassName": {
208 | "description": "Class name to be added to the editor.",
209 | "type": "string"
210 | },
211 | "fastScrollSensitivity": {
212 | "default": 5,
213 | "description": "FastScrolling mulitplier speed when pressing Alt Defaults to 5.",
214 | "type": "number"
215 | },
216 | "find": {
217 | "$ref": "#/$defs/IEditorFindOptions"
218 | },
219 | "fixedOverflowWidgets": {
220 | "default": false,
221 | "description": "Display overflow widgets as fixed. Defaults to false.",
222 | "type": "boolean"
223 | },
224 | "folding": {
225 | "default": true,
226 | "description": "Enable code folding. Defaults to true.",
227 | "type": "boolean"
228 | },
229 | "foldingHighlight": {
230 | "default": true,
231 | "description": "Enable highlight for folded regions. Defaults to true.",
232 | "type": "boolean"
233 | },
234 | "foldingImportsByDefault": {
235 | "default": true,
236 | "description": "Auto fold imports folding regions. Defaults to true.",
237 | "type": "boolean"
238 | },
239 | "foldingMaximumRegions": {
240 | "default": 5000,
241 | "description": "Maximum number of foldable regions. Defaults to 5000.",
242 | "type": "number"
243 | },
244 | "foldingStrategy": {
245 | "default": "auto",
246 | "description": "Selects the folding strategy. 'auto' uses the strategies contributed for the current document, 'indentation' uses the indentation based folding strategy. Defaults to 'auto'.",
247 | "enum": [
248 | "auto",
249 | "indentation"
250 | ],
251 | "type": "string"
252 | },
253 | "fontFamily": {
254 | "description": "The font family",
255 | "type": "string"
256 | },
257 | "fontLigatures": {
258 | "default": false,
259 | "description": "Enable font ligatures. Defaults to false.",
260 | "type": "boolean"
261 | },
262 | "fontSize": {
263 | "description": "The font size",
264 | "type": "number"
265 | },
266 | "fontVariations": {
267 | "default": false,
268 | "description": "Enable font variations. Defaults to false.",
269 | "type": [
270 | "boolean",
271 | "string"
272 | ]
273 | },
274 | "fontWeight": {
275 | "description": "The font weight",
276 | "type": "string"
277 | },
278 | "formatOnPaste": {
279 | "default": false,
280 | "description": "Enable format on paste. Defaults to false.",
281 | "type": "boolean"
282 | },
283 | "formatOnType": {
284 | "default": false,
285 | "description": "Enable format on type. Defaults to false.",
286 | "type": "boolean"
287 | },
288 | "glyphMargin": {
289 | "default": false,
290 | "description": "Enable the rendering of the glyph margin. Defaults to true in vscode and to false in monaco-editor.",
291 | "type": "boolean"
292 | },
293 | "gotoLocation": {
294 | "$ref": "#/$defs/IGotoLocationOptions"
295 | },
296 | "guides": {
297 | "$ref": "#/$defs/IGuidesOptions"
298 | },
299 | "hideCursorInOverviewRuler": {
300 | "default": false,
301 | "description": "Should the cursor be hidden in the overview ruler. Defaults to false.",
302 | "type": "boolean"
303 | },
304 | "hover": {
305 | "$ref": "#/$defs/IEditorHoverOptions"
306 | },
307 | "inDiffEditor": {
308 | "description": "This editor is used inside a diff editor.",
309 | "type": "boolean"
310 | },
311 | "inlayHints": {
312 | "$ref": "#/$defs/IEditorInlayHintsOptions"
313 | },
314 | "inlineSuggest": {
315 | "$ref": "#/$defs/IInlineSuggestOptions"
316 | },
317 | "letterSpacing": {
318 | "description": "The letter spacing",
319 | "type": "number"
320 | },
321 | "lightbulb": {
322 | "$ref": "#/$defs/IEditorLightbulbOptions"
323 | },
324 | "lineDecorationsWidth": {
325 | "default": 10,
326 | "description": "The width reserved for line decorations (in px). Line decorations are placed between line numbers and the editor content. You can pass in a string in the format floating point followed by \"ch\". e.g. 1.3ch. Defaults to 10.",
327 | "type": [
328 | "string",
329 | "number"
330 | ]
331 | },
332 | "lineHeight": {
333 | "description": "The line height.",
334 | "type": "number"
335 | },
336 | "lineNumbers": {
337 | "$ref": "#/$defs/LineNumbersType"
338 | },
339 | "lineNumbersMinChars": {
340 | "default": 5,
341 | "description": "Control the width of line numbers, by reserving horizontal space for rendering at least an amount of digits. Defaults to 5.",
342 | "type": "number"
343 | },
344 | "linkedEditing": {
345 | "default": false,
346 | "description": "Enable linked editing. Defaults to false.",
347 | "type": "boolean"
348 | },
349 | "links": {
350 | "default": true,
351 | "description": "Enable detecting links and making them clickable. Defaults to true.",
352 | "type": "boolean"
353 | },
354 | "matchBrackets": {
355 | "default": "always",
356 | "description": "Enable highlighting of matching brackets. Defaults to 'always'.",
357 | "enum": [
358 | "always",
359 | "never",
360 | "near"
361 | ],
362 | "type": "string"
363 | },
364 | "matchOnWordStartOnly": {
365 | "description": "Controls whether suggestions allow matches in the middle of the word instead of only at the beginning",
366 | "type": "boolean"
367 | },
368 | "minimap": {
369 | "$ref": "#/$defs/IEditorMinimapOptions"
370 | },
371 | "mouseStyle": {
372 | "default": "text",
373 | "description": "Control the mouse pointer style, either 'text' or 'default' or 'copy' Defaults to 'text'",
374 | "enum": [
375 | "default",
376 | "text",
377 | "copy"
378 | ],
379 | "type": "string"
380 | },
381 | "mouseWheelScrollSensitivity": {
382 | "default": 1,
383 | "description": "A multiplier to be used on the deltaX and deltaY of mouse wheel scroll events. Defaults to 1.",
384 | "type": "number"
385 | },
386 | "mouseWheelZoom": {
387 | "default": false,
388 | "description": "Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl. Defaults to false.",
389 | "type": "boolean"
390 | },
391 | "multiCursorLimit": {
392 | "description": "Controls the max number of text cursors that can be in an active editor at once.",
393 | "type": "number"
394 | },
395 | "multiCursorMergeOverlapping": {
396 | "default": true,
397 | "description": "Merge overlapping selections. Defaults to true",
398 | "type": "boolean"
399 | },
400 | "multiCursorModifier": {
401 | "default": "all",
402 | "description": "The modifier to be used to add multiple cursors with the mouse. Defaults to 'alt'",
403 | "enum": [
404 | "ctrlCmd",
405 | "alt"
406 | ],
407 | "type": "string"
408 | },
409 | "multiCursorPaste": {
410 | "default": "spread",
411 | "description": "Configure the behaviour when pasting a text with the line count equal to the cursor count. Defaults to 'spread'.",
412 | "enum": [
413 | "spread",
414 | "full"
415 | ],
416 | "type": "string"
417 | },
418 | "occurrencesHighlight": {
419 | "default": true,
420 | "description": "Enable semantic occurrences highlight. Defaults to true.",
421 | "type": "boolean"
422 | },
423 | "overviewRulerBorder": {
424 | "default": true,
425 | "description": "Controls if a border should be drawn around the overview ruler. Defaults to true.",
426 | "type": "boolean"
427 | },
428 | "overviewRulerLanes": {
429 | "default": 3,
430 | "description": "The number of vertical lanes the overview ruler should render. Defaults to 3.",
431 | "type": "number"
432 | },
433 | "padding": {
434 | "$ref": "#/$defs/IEditorPaddingOptions"
435 | },
436 | "parameterHints": {
437 | "$ref": "#/$defs/IEditorParameterHintOptions"
438 | },
439 | "peekWidgetDefaultFocus": {
440 | "default": false,
441 | "description": "Controls whether to focus the inline editor in the peek widget by default. Defaults to false.",
442 | "enum": [
443 | false,
444 | "tree",
445 | "editor"
446 | ],
447 | "type": [
448 | "boolean",
449 | "string"
450 | ]
451 | },
452 | "quickSuggestions": {
453 | "$ref": "#/$defs/IQuickSuggestionsOptions"
454 | },
455 | "quickSuggestionsDelay": {
456 | "default": 10,
457 | "description": "Quick suggestions show delay (in ms) Defaults to 10 (ms)",
458 | "type": "number"
459 | },
460 | "readOnly": {
461 | "default": false,
462 | "description": "Should the editor be read only. See also domReadOnly. Defaults to false.",
463 | "type": "boolean"
464 | },
465 | "renameOnType": {
466 | "description": "deprecated, use linkedEditing instead.",
467 | "type": "boolean"
468 | },
469 | "renderControlCharacters": {
470 | "default": true,
471 | "description": "Enable rendering of control characters. Defaults to true.",
472 | "type": "boolean"
473 | },
474 | "renderFinalNewline": {
475 | "default": "on",
476 | "description": "Render last line number when the file ends with a newline. Defaults to 'on' for Windows and macOS and 'dimmed' for Linux.",
477 | "enum": [
478 | "on",
479 | "off",
480 | "dimmed"
481 | ],
482 | "type": "string"
483 | },
484 | "renderLineHighlight": {
485 | "default": "all",
486 | "description": "Enable rendering of current line highlight. Defaults to all.",
487 | "enum": [
488 | "all",
489 | "line",
490 | "none",
491 | "gutter"
492 | ],
493 | "type": "string"
494 | },
495 | "renderLineHighlightOnlyWhenFocus": {
496 | "default": false,
497 | "description": "Control if the current line highlight should be rendered only the editor is focused. Defaults to false.",
498 | "type": "boolean"
499 | },
500 | "renderValidationDecorations": {
501 | "default": "editable",
502 | "description": "Should the editor render validation decorations. Defaults to editable.",
503 | "enum": [
504 | "on",
505 | "off",
506 | "editable"
507 | ],
508 | "type": "string"
509 | },
510 | "renderWhitespace": {
511 | "default": "selection",
512 | "description": "Enable rendering of whitespace. Defaults to 'selection'.",
513 | "enum": [
514 | "all",
515 | "none",
516 | "boundary",
517 | "selection",
518 | "trailing"
519 | ],
520 | "type": "string"
521 | },
522 | "revealHorizontalRightPadding": {
523 | "default": 30,
524 | "description": "When revealing the cursor, a virtual padding (px) is added to the cursor, turning it into a rectangle. This virtual padding ensures that the cursor gets revealed before hitting the edge of the viewport. Defaults to 30 (px).",
525 | "type": "number"
526 | },
527 | "roundedSelection": {
528 | "default": true,
529 | "description": "Render the editor selection with rounded borders. Defaults to true.",
530 | "type": "boolean"
531 | },
532 | "rulers": {
533 | "default": [],
534 | "description": "Render vertical lines at the specified columns. Defaults to empty array.",
535 | "items": {
536 | "oneOf": [
537 | {
538 | "type": "number"
539 | },
540 | {
541 | "$ref": "#/$defs/IRulerOption"
542 | }
543 | ]
544 | },
545 | "type": "array"
546 | },
547 | "screenReaderAnnounceInlineSuggestion": {
548 | "description": "Control whether a screen reader announces inline suggestion content immediately.",
549 | "type": "boolean"
550 | },
551 | "scrollBeyondLastColumn": {
552 | "default": 5,
553 | "description": "Enable that scrolling can go beyond the last column by a number of columns. Defaults to 5.",
554 | "type": "number"
555 | },
556 | "scrollBeyondLastLine": {
557 | "default": true,
558 | "description": "Enable that scrolling can go one screen size after the last line. Defaults to true.",
559 | "type": "boolean"
560 | },
561 | "scrollPredominantAxis": {
562 | "default": true,
563 | "description": "Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad. Defaults to true.",
564 | "type": "boolean"
565 | },
566 | "scrollbar": {
567 | "$ref": "#/$defs/IEditorScrollbarOptions"
568 | },
569 | "selectOnLineNumbers": {
570 | "default": true,
571 | "description": "Should the corresponding line be selected when clicking on the line number? Defaults to true.",
572 | "type": "boolean"
573 | },
574 | "selectionClipboard": {
575 | "default": true,
576 | "description": "Enable Linux primary clipboard. Defaults to true.",
577 | "type": "boolean"
578 | },
579 | "selectionHighlight": {
580 | "default": true,
581 | "description": "Enable selection highlight. Defaults to true.",
582 | "type": "boolean"
583 | },
584 | "showDeprecated": {
585 | "description": "Controls strikethrough deprecated variables.",
586 | "type": "boolean"
587 | },
588 | "showFoldingControls": {
589 | "default": "mouseover",
590 | "description": "Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter. Defaults to 'mouseover'.",
591 | "enum": [
592 | "always",
593 | "never",
594 | "mouseover"
595 | ],
596 | "type": "string"
597 | },
598 | "showUnused": {
599 | "description": "Controls fading out of unused variables.",
600 | "type": "boolean"
601 | },
602 | "smartSelect": {
603 | "$ref": "#/$defs/ISmartSelectOptions"
604 | },
605 | "smoothScrolling": {
606 | "default": false,
607 | "description": "Enable that the editor animates scrolling to a position. Defaults to false.",
608 | "type": "boolean"
609 | },
610 | "snippetSuggestions": {
611 | "default": true,
612 | "description": "Enable snippet suggestions. Default to 'true'.",
613 | "enum": [
614 | true,
615 | "none",
616 | "top",
617 | "bottom",
618 | "inline"
619 | ],
620 | "type": [
621 | "boolean",
622 | "string"
623 | ]
624 | },
625 | "stickyScroll": {
626 | "$ref": "#/$defs/IEditorStickyScrollOptions"
627 | },
628 | "stickyTabStops": {
629 | "description": "Emulate selection behaviour of tab characters when using spaces for indentation. This means selection will stick to tab stops.",
630 | "type": "boolean"
631 | },
632 | "stopRenderingLineAfter": {
633 | "default": 10000,
634 | "description": "Performance guard: Stop rendering a line after x characters. Defaults to 10000. Use -1 to never stop rendering",
635 | "type": "number"
636 | },
637 | "suggest": {
638 | "$ref": "#/$defs/ISuggestOptions"
639 | },
640 | "suggestFontSize": {
641 | "description": "The font size for the suggest widget. Defaults to the editor font size.",
642 | "type": "number"
643 | },
644 | "suggestLineHeight": {
645 | "description": "The line height for the suggest widget. Defaults to the editor line height.",
646 | "type": "number"
647 | },
648 | "suggestOnTriggerCharacters": {
649 | "default": true,
650 | "description": "Enable the suggestion box to pop-up on trigger characters. Defaults to true.",
651 | "type": "boolean"
652 | },
653 | "suggestSelection": {
654 | "description": "The history mode for suggestions.",
655 | "enum": [
656 | "first",
657 | "recentlyUsed",
658 | "recentlyUsedByPrefix"
659 | ],
660 | "type": "string"
661 | },
662 | "tabCompletion": {
663 | "description": "Enable tab completion.",
664 | "enum": [
665 | "on",
666 | "off",
667 | "onlySnippets"
668 | ],
669 | "type": "string"
670 | },
671 | "tabFocusMode": {
672 | "description": "Controls whether the editor receives tabs or defers them to the workbench for navigation.",
673 | "type": "boolean"
674 | },
675 | "tabIndex": {
676 | "description": "The tabindex property of the editor's textarea.",
677 | "type": "number"
678 | },
679 | "unfoldOnClickAfterEndOfLine": {
680 | "default": false,
681 | "description": "Controls whether clicking on the empty content after a folded line will unfold the line. Defaults to false.",
682 | "type": "boolean"
683 | },
684 | "unicodeHighlight": {
685 | "$ref": "#/$defs/IUnicodeHighlightOptions"
686 | },
687 | "unusualLineTerminators": {
688 | "default": "prompt",
689 | "description": "Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS). Defaults to 'prompt'.",
690 | "enum": [
691 | "off",
692 | "auto",
693 | "prompt"
694 | ],
695 | "type": "string"
696 | },
697 | "useShadowDOM": {
698 | "description": "Control if the editor should use shadow DOM.",
699 | "type": "boolean"
700 | },
701 | "useTabStops": {
702 | "description": "Inserting and deleting whitespace follows tab stops.",
703 | "type": "boolean"
704 | },
705 | "wordBreak": {
706 | "default": "normal",
707 | "description": "Sets whether line breaks appear wherever the text would otherwise overflow its content box. When wordBreak = 'normal', Use the default line break rule. When wordBreak = 'keepAll', Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.",
708 | "enum": [
709 | "normal",
710 | "keepAll"
711 | ],
712 | "type": "string"
713 | },
714 | "wordSeparators": {
715 | "default": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",
716 | "description": "A string containing the word separators used when doing word navigation. Defaults to `~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",
717 | "type": "string"
718 | },
719 | "wordWrap": {
720 | "default": "off",
721 | "description": "Control the wrapping of the editor. When wordWrap = \"off\", the lines will never wrap. When wordWrap = \"on\", the lines will wrap at the viewport width. When wordWrap = \"wordWrapColumn\", the lines will wrap at wordWrapColumn. When wordWrap = \"bounded\", the lines will wrap at min(viewport width, wordWrapColumn). Defaults to \"off\".",
722 | "enum": [
723 | "on",
724 | "off",
725 | "wordWrapColumn",
726 | "bounded"
727 | ],
728 | "type": "string"
729 | },
730 | "wordWrapBreakAfterCharacters": {
731 | "description": "Configure word wrapping characters. A break will be introduced before these characters.",
732 | "type": "string"
733 | },
734 | "wordWrapBreakBeforeCharacters": {
735 | "description": "Configure word wrapping characters. A break will be introduced before these characters.",
736 | "type": "string"
737 | },
738 | "wordWrapColumn": {
739 | "default": 80,
740 | "description": "Control the wrapping of the editor. When wordWrap = \"off\", the lines will never wrap. When wordWrap = \"on\", the lines will wrap at the viewport width. When wordWrap = \"wordWrapColumn\", the lines will wrap at wordWrapColumn. When wordWrap = \"bounded\", the lines will wrap at min(viewport width, wordWrapColumn). Defaults to 80.",
741 | "type": "number"
742 | },
743 | "wordWrapOverride1": {
744 | "description": "Override the wordWrap setting.",
745 | "enum": [
746 | "on",
747 | "off",
748 | "inherit"
749 | ],
750 | "type": "string"
751 | },
752 | "wordWrapOverride2": {
753 | "description": "Override the wordWrapOverride1 setting.",
754 | "enum": [
755 | "on",
756 | "off",
757 | "inherit"
758 | ],
759 | "type": "string"
760 | },
761 | "wrappingIndent": {
762 | "default": "none",
763 | "description": "Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'. Defaults to 'same' in vscode and to 'none' in monaco-editor.",
764 | "enum": [
765 | "none",
766 | "same",
767 | "indent",
768 | "deepIndent"
769 | ],
770 | "type": "string"
771 | },
772 | "wrappingStrategy": {
773 | "default": "simple",
774 | "description": "Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'. Defaults to 'same' in vscode and to 'none' in monaco-editor.",
775 | "enum": [
776 | "simple",
777 | "advanced"
778 | ],
779 | "type": "string"
780 | }
781 | },
782 | "$defs": {
783 | "EditorAutoClosingStrategy": {
784 | "default": "languageDefined",
785 | "description": "Options for auto closing brackets. Defaults to language defined behavior.",
786 | "enum": [
787 | "always",
788 | "languageDefined",
789 | "beforeWhitespace",
790 | "never"
791 | ],
792 | "type": "string"
793 | },
794 | "EditorAutoClosingEditStrategy": {
795 | "default": "auto",
796 | "description": "Options for pressing backspace near quotes or bracket pairs.",
797 | "enum": [
798 | "always",
799 | "auto",
800 | "never"
801 | ],
802 | "type": "string"
803 | },
804 | "EditorAutoSurroundStrategy": {
805 | "default": "languageDefined",
806 | "description": "Configuration options for auto wrapping quotes and brackets.",
807 | "enum": [
808 | "languageDefined",
809 | "quotes",
810 | "brackets",
811 | "never"
812 | ],
813 | "type": "string"
814 | },
815 | "IBracketPairColorizationOptions": {
816 | "description": "Configures bracket pair colorization (disabled by default).",
817 | "properties": {
818 | "enabled": {
819 | "default": false,
820 | "description": "Enable or disable bracket pair colorization.",
821 | "type": "boolean"
822 | },
823 | "independentColorPoolPerBracketType": {
824 | "default": false,
825 | "description": "Use independent color pool per bracket type.",
826 | "type": "boolean"
827 | }
828 | },
829 | "type": "object"
830 | },
831 | "IEditorCommentsOptions": {
832 | "description": "Control the behaviour of comments in the editor.",
833 | "properties": {
834 | "ignoreEmptyLines": {
835 | "default": true,
836 | "description": "Ignore empty lines when inserting line comments. Defaults to true.",
837 | "type": "boolean"
838 | },
839 | "insertSpace": {
840 | "default": true,
841 | "description": "Insert a space after the line comment token and inside the block comments tokens. Defaults to true.",
842 | "type": "boolean"
843 | }
844 | },
845 | "type": "object"
846 | },
847 | "IDropIntoEditorOptions": {
848 | "description": "Controls dropping into the editor from an external source. When enabled, this shows a preview of the drop location and triggers an onDropIntoEditor event.",
849 | "properties": {
850 | "enabled": {
851 | "default": true,
852 | "description": "Enable the dropping into editor. Defaults to true.",
853 | "type": "boolean"
854 | }
855 | },
856 | "type": "object"
857 | },
858 | "IEditorFindOptions": {
859 | "description": "Control the behavior of the find widget.",
860 | "properties": {
861 | "addExtraSpaceOnTop": {
862 | "description": "",
863 | "type": "boolean"
864 | },
865 | "autoFindInSelection": {
866 | "description": "Controls if Find in Selection flag is turned on in the editor.",
867 | "enum": [
868 | "always",
869 | "never",
870 | "multiline"
871 | ],
872 | "type": "string"
873 | },
874 | "cursorMoveOnType": {
875 | "description": "Controls whether the cursor should move to find matches while typing.",
876 | "type": "boolean"
877 | },
878 | "loop": {
879 | "description": "Controls whether the search result and diff result automatically restarts from the beginning (or the end) when no further matches can be found.",
880 | "type": "boolean"
881 | },
882 | "seedSearchStringFromSelection": {
883 | "description": "Controls if we seed search string in the Find Widget with editor selection.",
884 | "enum": [
885 | "always",
886 | "never",
887 | "selection"
888 | ],
889 | "type": "string"
890 | }
891 | },
892 | "type": "object"
893 | },
894 | "IGotoLocationOptions": {
895 | "description": "Configuration options for go to location.",
896 | "properties": {
897 | "alternativeDeclarationCommand": {
898 | "type": "string"
899 | },
900 | "alternativeDefinitionCommand": {
901 | "type": "string"
902 | },
903 | "alternativeImplementationCommand": {
904 | "type": "string"
905 | },
906 | "alternativeReferenceCommand": {
907 | "type": "string"
908 | },
909 | "alternativeTypeDefinitionCommand": {
910 | "type": "string"
911 | },
912 | "multiple": {
913 | "$ref": "#/$defs/GoToLocationValues"
914 | },
915 | "multipleDeclarations": {
916 | "$ref": "#/$defs/GoToLocationValues"
917 | },
918 | "multipleDefinitions": {
919 | "$ref": "#/$defs/GoToLocationValues"
920 | },
921 | "multipleImplementations": {
922 | "$ref": "#/$defs/GoToLocationValues"
923 | },
924 | "multipleReferences": {
925 | "$ref": "#/$defs/GoToLocationValues"
926 | },
927 | "multipleTypeDefinitions": {
928 | "$ref": "#/$defs/GoToLocationValues"
929 | }
930 | },
931 | "type": "object"
932 | },
933 | "GoToLocationValues": {
934 | "enum": [
935 | "peek",
936 | "gotoAndPeek",
937 | "goto"
938 | ],
939 | "type": "string"
940 | },
941 | "IGuidesOptions": {
942 | "description": "Controls the behavior of editor guides.",
943 | "properties": {
944 | "bracketPairs": {
945 | "default": false,
946 | "description": "Enable rendering of bracket pair guides. Defaults to false.",
947 | "enum": [
948 | true,
949 | false,
950 | "active"
951 | ],
952 | "type": [
953 | "boolean",
954 | "string"
955 | ]
956 | },
957 | "bracketPairsHorizontal": {
958 | "default": "active",
959 | "description": "Enable rendering of vertical bracket pair guides. Defaults to 'active'.",
960 | "enum": [
961 | true,
962 | false,
963 | "active"
964 | ],
965 | "type": [
966 | "boolean",
967 | "string"
968 | ]
969 | },
970 | "highlightActiveBracketPair": {
971 | "default": true,
972 | "description": "Enable highlighting of the active bracket pair. Defaults to true.",
973 | "type": "boolean"
974 | },
975 | "highlightActiveIndentation": {
976 | "default": true,
977 | "description": "Enable highlighting of the active indent guide. Defaults to true.",
978 | "enum": [
979 | true,
980 | false,
981 | "always"
982 | ],
983 | "type": [
984 | "boolean",
985 | "string"
986 | ]
987 | },
988 | "indentation": {
989 | "default": true,
990 | "description": "Enable rendering of indent guides. Defaults to true.",
991 | "type": "boolean"
992 | }
993 | },
994 | "type": "object"
995 | },
996 | "IEditorHoverOptions": {
997 | "description": "Configure the editor's hover.",
998 | "properties": {
999 | "above": {
1000 | "default": false,
1001 | "description": "Should the hover be shown above the line if possible? Defaults to false.",
1002 | "type": "boolean"
1003 | },
1004 | "delay": {
1005 | "default": 300,
1006 | "description": "Delay for showing the hover. Defaults to 300.",
1007 | "type": "number"
1008 | },
1009 | "enabled": {
1010 | "default": true,
1011 | "description": "Enable the hover. Defaults to true.",
1012 | "type": "boolean"
1013 | },
1014 | "sticky": {
1015 | "default": true,
1016 | "description": "Is the hover sticky such that it can be clicked and its contents selected? Defaults to true.",
1017 | "type": "boolean"
1018 | }
1019 | },
1020 | "type": "object"
1021 | },
1022 | "IEditorInlayHintsOptions": {
1023 | "description": "Control the behavior and rendering of the inline hints.",
1024 | "properties": {
1025 | "enabled": {
1026 | "default": true,
1027 | "description": "Enable the inline hints. Defaults to true.",
1028 | "enum": [
1029 | true,
1030 | false,
1031 | "on",
1032 | "off",
1033 | "offUnlessPressed",
1034 | "onUnlessPressed"
1035 | ],
1036 | "type": [
1037 | "boolean",
1038 | "string"
1039 | ]
1040 | },
1041 | "fontFamily": {
1042 | "description": "Font family of inline hints. Defaults to editor font family.",
1043 | "type": "string"
1044 | },
1045 | "fontSize": {
1046 | "description": "Font size of inline hints. Default to 90% of the editor font size.",
1047 | "type": "number"
1048 | },
1049 | "padding": {
1050 | "description": "Font size of inline hints. Default to 90% of the editor font size.",
1051 | "type": "number"
1052 | }
1053 | },
1054 | "type": "object"
1055 | },
1056 | "IInlineSuggestOptions": {
1057 | "description": "Inline suggest options.",
1058 | "properties": {
1059 | "enabled": {
1060 | "description": "Enable or disable the rendering of automatic inline completions.",
1061 | "type": "boolean"
1062 | },
1063 | "mode": {
1064 | "default": "prefix",
1065 | "description": "Configures the mode. Use prefix to only show ghost text if the text to replace is a prefix of the suggestion text. Use subword to only show ghost text if the replace text is a subword of the suggestion text. Use subwordSmart to only show ghost text if the replace text is a subword of the suggestion text, but the subword must start after the cursor position. Defaults to prefix.",
1066 | "enum": [
1067 | "prefix",
1068 | "subword",
1069 | "subwordSmart"
1070 | ],
1071 | "type": "string"
1072 | },
1073 | "showToolbar": {
1074 | "description": "Determines whether the toolbar is displayed.",
1075 | "enum": [
1076 | "always",
1077 | "onHover"
1078 | ],
1079 | "type": "string"
1080 | },
1081 | "suppressSuggestions": {
1082 | "description": "Whether suggestions should be supressed.",
1083 | "type": "boolean"
1084 | }
1085 | },
1086 | "type": "object"
1087 | },
1088 | "IEditorLightbulbOptions": {
1089 | "description": "Control the behavior and rendering of the code action lightbulb.",
1090 | "properties": {
1091 | "enabled": {
1092 | "description": "Enable the lightbulb code action. Defaults to true.",
1093 | "type": "boolean"
1094 | }
1095 | },
1096 | "type": "object"
1097 | },
1098 | "LineNumbersType": {
1099 | "default": "on",
1100 | "description": "Control the rendering of line numbers. If it is a function, it will be invoked when rendering a line number and the return value will be rendered. Otherwise, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function). Otherwise, line numbers will not be rendered. Defaults to on.",
1101 | "enum": [
1102 | "on",
1103 | "off",
1104 | "relative",
1105 | "interval"
1106 | ],
1107 | "type": "string"
1108 | },
1109 | "IEditorMinimapOptions": {
1110 | "description": "Controls dropping into the editor from an external source. When enabled, this shows a preview of the drop location and triggers an onDropIntoEditor event.",
1111 | "properties": {
1112 | "autohide": {
1113 | "description": "Control the rendering of minimap.",
1114 | "type": "boolean"
1115 | },
1116 | "enabled": {
1117 | "default": true,
1118 | "description": "Enable the rendering of the minimap. Defaults to true.",
1119 | "type": "boolean"
1120 | },
1121 | "maxColumn": {
1122 | "default": 120,
1123 | "description": "Limit the width of the minimap to render at most a certain number of columns. Defaults to 120.",
1124 | "type": "number"
1125 | },
1126 | "renderCharacters": {
1127 | "default": true,
1128 | "description": "Render the actual text on a line (as opposed to color blocks). Defaults to true.",
1129 | "type": "boolean"
1130 | },
1131 | "scale": {
1132 | "default": 1,
1133 | "description": "Relative size of the font in the minimap. Defaults to 1.",
1134 | "type": "number"
1135 | },
1136 | "showSlider": {
1137 | "default": "mouseover",
1138 | "description": "Control the rendering of the minimap slider. Defaults to 'mouseover'.",
1139 | "enum": [
1140 | "always",
1141 | "mouseover"
1142 | ],
1143 | "type": "string"
1144 | },
1145 | "side": {
1146 | "default": "right",
1147 | "description": "Control the side of the minimap in editor. Defaults to 'right'.",
1148 | "enum": [
1149 | "right",
1150 | "left"
1151 | ],
1152 | "type": "string"
1153 | },
1154 | "size": {
1155 | "default": "actual",
1156 | "description": "Control the minimap rendering mode. Defaults to 'actual'.",
1157 | "enum": [
1158 | "actual",
1159 | "proportional",
1160 | "fill",
1161 | "fit"
1162 | ],
1163 | "type": "string"
1164 | }
1165 | },
1166 | "type": "object"
1167 | },
1168 | "IEditorPaddingOptions": {
1169 | "description": "Controls the spacing around the editor.",
1170 | "properties": {
1171 | "bottom": {
1172 | "description": "Spacing between bottom edge of editor and last line.",
1173 | "type": "number"
1174 | },
1175 | "top": {
1176 | "description": "Spacing between top edge of editor and first line.",
1177 | "type": "number"
1178 | }
1179 | },
1180 | "type": "object"
1181 | },
1182 | "IEditorParameterHintOptions": {
1183 | "description": "Parameter hint options.",
1184 | "properties": {
1185 | "cycle": {
1186 | "default": false,
1187 | "description": "Enable cycling of parameter hints. Defaults to false.",
1188 | "type": "boolean"
1189 | },
1190 | "enabled": {
1191 | "default": true,
1192 | "description": "Enable parameter hints. Defaults to true.",
1193 | "type": "boolean"
1194 | }
1195 | },
1196 | "type": "object"
1197 | },
1198 | "IQuickSuggestionsOptions": {
1199 | "default": true,
1200 | "description": "Enable quick suggestions (shadow suggestions) Defaults to true.",
1201 | "properties": {
1202 | "comments": {
1203 | "$ref": "#/$defs/QuickSuggestionsValue"
1204 | },
1205 | "other": {
1206 | "$ref": "#/$defs/QuickSuggestionsValue"
1207 | },
1208 | "strings": {
1209 | "$ref": "#/$defs/QuickSuggestionsValue"
1210 | }
1211 | },
1212 | "type": [
1213 | "boolean",
1214 | "object"
1215 | ]
1216 | },
1217 | "IRulerOption": {
1218 | "properties": {
1219 | "color": {
1220 | "type": "string"
1221 | },
1222 | "column": {
1223 | "type": "number"
1224 | }
1225 | },
1226 | "type": "object"
1227 | },
1228 | "QuickSuggestionsValue": {
1229 | "enum": [
1230 | true,
1231 | false,
1232 | "on",
1233 | "inline",
1234 | "off"
1235 | ],
1236 | "type": [
1237 | "boolean",
1238 | "string"
1239 | ]
1240 | },
1241 | "IEditorScrollbarOptions": {
1242 | "description": "Control the behavior and rendering of the scrollbars.",
1243 | "properties": {
1244 | "alwaysConsumeMouseWheel": {
1245 | "default": true,
1246 | "description": "Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events). Defaults to true. NOTE: This option cannot be updated using updateOptions()",
1247 | "type": "boolean"
1248 | },
1249 | "arrowSize": {
1250 | "default": 11,
1251 | "description": "The size of arrows (if displayed). Defaults to 11. NOTE: This option cannot be updated using updateOptions()",
1252 | "type": "number"
1253 | },
1254 | "handleMouseWheel": {
1255 | "default": true,
1256 | "description": "Listen to mouse wheel events and react to them by scrolling. Defaults to true.",
1257 | "type": "boolean"
1258 | },
1259 | "horizontal": {
1260 | "default": "auto",
1261 | "description": "Render horizontal scrollbar. Defaults to 'auto'.",
1262 | "enum": [
1263 | "auto",
1264 | "visible",
1265 | "hidden"
1266 | ],
1267 | "type": "string"
1268 | },
1269 | "horizontalHasArrows": {
1270 | "default": false,
1271 | "description": "Render arrows at the left and right of the horizontal scrollbar. Defaults to false. NOTE: This option cannot be updated using updateOptions()",
1272 | "type": "boolean"
1273 | },
1274 | "horizontalScrollbarSize": {
1275 | "default": 10,
1276 | "description": "Height in pixels for the horizontal scrollbar. Defaults to 10 (px).",
1277 | "type": "number"
1278 | },
1279 | "horizontalSliderSize": {
1280 | "description": "Height in pixels for the horizontal slider. Defaults to horizontalScrollbarSize. NOTE: This option cannot be updated using updateOptions()",
1281 | "type": "number"
1282 | },
1283 | "scrollByPage": {
1284 | "default": false,
1285 | "description": "Scroll gutter clicks move by page vs jump to position. Defaults to false.",
1286 | "type": "boolean"
1287 | },
1288 | "useShadows": {
1289 | "default": true,
1290 | "description": "Cast horizontal and vertical shadows when the content is scrolled. Defaults to true. NOTE: This option cannot be updated using updateOptions()",
1291 | "type": "boolean"
1292 | },
1293 | "vertical": {
1294 | "default": "auto",
1295 | "description": "Render vertical scrollbar. Defaults to 'auto'.",
1296 | "enum": [
1297 | "auto",
1298 | "visible",
1299 | "hidden"
1300 | ],
1301 | "type": "string"
1302 | },
1303 | "verticalHasArrows": {
1304 | "default": false,
1305 | "description": "Render arrows at the top and bottom of the vertical scrollbar. Defaults to false. NOTE: This option cannot be updated using updateOptions()",
1306 | "type": "boolean"
1307 | },
1308 | "verticalScrollbarSize": {
1309 | "default": 10,
1310 | "description": "Width in pixels for the vertical scrollbar. Defaults to 10 (px).",
1311 | "type": "number"
1312 | },
1313 | "verticalSliderSize": {
1314 | "description": "Width in pixels for the vertical slider. Defaults to verticalScrollbarSize. NOTE: This option cannot be updated using updateOptions()",
1315 | "type": "number"
1316 | }
1317 | },
1318 | "type": "object"
1319 | },
1320 | "ISmartSelectOptions": {
1321 | "description": "Smart select options.",
1322 | "properties": {
1323 | "selectLeadingAndTrailingWhitespace": {
1324 | "type": "boolean"
1325 | }
1326 | },
1327 | "type": "object"
1328 | },
1329 | "IEditorStickyScrollOptions": {
1330 | "description": "Control the behavior of sticky scroll options",
1331 | "properties": {
1332 | "defaultModel": {
1333 | "description": "Model to choose for sticky scroll by default",
1334 | "enum": [
1335 | "outlineModel",
1336 | "foldingProviderModel",
1337 | "indentationModel"
1338 | ],
1339 | "type": "string"
1340 | },
1341 | "enabled": {
1342 | "description": "Enable the sticky scroll",
1343 | "type": "boolean"
1344 | },
1345 | "maxLineCount": {
1346 | "description": "Maximum number of sticky lines to show",
1347 | "type": "number"
1348 | }
1349 | },
1350 | "type": "object"
1351 | },
1352 | "ISuggestOptions": {
1353 | "description": "Suggest options",
1354 | "properties": {
1355 | "filterGraceful": {
1356 | "default": true,
1357 | "description": "Enable graceful matching. Defaults to true.",
1358 | "type": "boolean"
1359 | },
1360 | "insertMode": {
1361 | "default": false,
1362 | "description": "Overwrite word ends on accept. Default to false.",
1363 | "enum": [
1364 | true,
1365 | false,
1366 | "insert",
1367 | "replace"
1368 | ],
1369 | "type": [
1370 | "boolean",
1371 | "string"
1372 | ]
1373 | },
1374 | "localityBonus": {
1375 | "description": "Favors words that appear close to the cursor.",
1376 | "type": "boolean"
1377 | },
1378 | "matchOnWordStartOnly": {
1379 | "description": "Controls whether suggestions allow matches in the middle of the word instead of only at the beginning.",
1380 | "type": "boolean"
1381 | },
1382 | "preview": {
1383 | "description": "Enable or disable the rendering of the suggestion preview.",
1384 | "type": "boolean"
1385 | },
1386 | "previewMode": {
1387 | "description": "Configures the mode of the preview.",
1388 | "enum": [
1389 | "prefix",
1390 | "subword",
1391 | "subwordSmart"
1392 | ],
1393 | "type": "string"
1394 | },
1395 | "selectionMode": {
1396 | "description": "Select suggestions when triggered via quick suggest or trigger characters.",
1397 | "enum": [
1398 | "always",
1399 | "never",
1400 | "whenTriggerCharacter",
1401 | "whenQuickSuggestion"
1402 | ],
1403 | "type": "string"
1404 | },
1405 | "shareSuggestSelections": {
1406 | "description": "Enable using global storage for remembering suggestions.",
1407 | "type": "boolean"
1408 | },
1409 | "showClasses": {
1410 | "description": "Show class-suggestions.",
1411 | "type": "boolean"
1412 | },
1413 | "showColors": {
1414 | "description": "Show color-suggestions.",
1415 | "type": "boolean"
1416 | },
1417 | "showConstants": {
1418 | "description": "Show constant-suggestions.",
1419 | "type": "boolean"
1420 | },
1421 | "showConstructors": {
1422 | "description": "Show constructor-suggestions.",
1423 | "type": "boolean"
1424 | },
1425 | "showDeprecated": {
1426 | "description": "Show deprecated-suggestions.",
1427 | "type": "boolean"
1428 | },
1429 | "showEnumMembers": {
1430 | "description": "Show enumMember-suggestions.",
1431 | "type": "boolean"
1432 | },
1433 | "showEnums": {
1434 | "description": "Show enum-suggestions.",
1435 | "type": "boolean"
1436 | },
1437 | "showEvents": {
1438 | "description": "Show event-suggestions.",
1439 | "type": "boolean"
1440 | },
1441 | "showFields": {
1442 | "description": "Show field-suggestions.",
1443 | "type": "boolean"
1444 | },
1445 | "showFiles": {
1446 | "description": "Show file-suggestions.",
1447 | "type": "boolean"
1448 | },
1449 | "showFolders": {
1450 | "description": "Show folder-suggestions.",
1451 | "type": "boolean"
1452 | },
1453 | "showFunctions": {
1454 | "description": "Show function-suggestions.",
1455 | "type": "boolean"
1456 | },
1457 | "showIcons": {
1458 | "default": true,
1459 | "description": "Enable or disable icons in suggestions. Defaults to true.",
1460 | "type": "boolean"
1461 | },
1462 | "showInlineDetails": {
1463 | "default": true,
1464 | "description": "Show details inline with the label. Defaults to true.",
1465 | "type": "boolean"
1466 | },
1467 | "showInterfaces": {
1468 | "description": "Show interface-suggestions.",
1469 | "type": "boolean"
1470 | },
1471 | "showIssues": {
1472 | "description": "Show issue-suggestions.",
1473 | "type": "boolean"
1474 | },
1475 | "showKeywords": {
1476 | "description": "Show keyword-suggestions.",
1477 | "type": "boolean"
1478 | },
1479 | "showMethods": {
1480 | "description": "Show method-suggestions.",
1481 | "type": "boolean"
1482 | },
1483 | "showModules": {
1484 | "description": "Show module-suggestions.",
1485 | "type": "boolean"
1486 | },
1487 | "showOperators": {
1488 | "description": "Show operator-suggestions.",
1489 | "type": "boolean"
1490 | },
1491 | "showProperties": {
1492 | "description": "Show property-suggestions.",
1493 | "type": "boolean"
1494 | },
1495 | "showReferences": {
1496 | "description": "Show reference-suggestions.",
1497 | "type": "boolean"
1498 | },
1499 | "showSnippets": {
1500 | "description": "Show snippet-suggestions.",
1501 | "type": "boolean"
1502 | },
1503 | "showStatusBar": {
1504 | "description": "Enable or disable the suggest status bar.",
1505 | "type": "boolean"
1506 | },
1507 | "showStructs": {
1508 | "description": "Show struct-suggestions.",
1509 | "type": "boolean"
1510 | },
1511 | "showTypeParameters": {
1512 | "description": "Show typeParameter-suggestions.",
1513 | "type": "boolean"
1514 | },
1515 | "showUnits": {
1516 | "description": "Show unit-suggestions.",
1517 | "type": "boolean"
1518 | },
1519 | "showUsers": {
1520 | "description": "Show user-suggestions.",
1521 | "type": "boolean"
1522 | },
1523 | "showValues": {
1524 | "description": "Show value-suggestions.",
1525 | "type": "boolean"
1526 | },
1527 | "showVariables": {
1528 | "description": "Show variable-suggestions.",
1529 | "type": "boolean"
1530 | },
1531 | "showWords": {
1532 | "description": "Show text-suggestions.",
1533 | "type": "boolean"
1534 | },
1535 | "snippetsPreventQuickSuggestions": {
1536 | "default": true,
1537 | "description": "Prevent quick suggestions when a snippet is active. Defaults to true.",
1538 | "type": "boolean"
1539 | }
1540 | },
1541 | "type": "object"
1542 | },
1543 | "IUnicodeHighlightOptions": {
1544 | "description": "Controls the behavior of the unicode highlight feature (by default, ambiguous and invisible characters are highlighted).",
1545 | "properties": {
1546 | "allowedCharacters": {
1547 | "additionalProperties": {
1548 | "type": "boolean",
1549 | "enum": [
1550 | true
1551 | ]
1552 | },
1553 | "description": "Defines allowed characters that are not being highlighted.",
1554 | "type": "object"
1555 | },
1556 | "allowedLocales": {
1557 | "additionalProperties": {
1558 | "type": "boolean",
1559 | "enum": [
1560 | true
1561 | ]
1562 | },
1563 | "description": "Unicode characters that are common in allowed locales are not being highlighted.",
1564 | "type": "object"
1565 | },
1566 | "ambiguousCharacters": {
1567 | "description": "Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.",
1568 | "type": "object"
1569 | },
1570 | "includeComments": {
1571 | "description": "Controls whether characters in comments should also be subject to unicode highlighting.",
1572 | "enum": [
1573 | true,
1574 | false,
1575 | "inUntrustedWorkspace"
1576 | ],
1577 | "type": [
1578 | "boolean",
1579 | "string"
1580 | ]
1581 | },
1582 | "includeStrings": {
1583 | "description": "Controls whether characters in strings should also be subject to unicode highlighting.",
1584 | "enum": [
1585 | true,
1586 | false,
1587 | "inUntrustedWorkspace"
1588 | ],
1589 | "type": [
1590 | "boolean",
1591 | "string"
1592 | ]
1593 | },
1594 | "invisibleCharacters": {
1595 | "description": "Controls whether characters that just reserve space or have no width at all are highlighted.",
1596 | "type": "boolean"
1597 | },
1598 | "nonBasicASCII": {
1599 | "description": "Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.",
1600 | "enum": [
1601 | true,
1602 | false,
1603 | "inUntrustedWorkspace"
1604 | ],
1605 | "type": [
1606 | "boolean",
1607 | "string"
1608 | ]
1609 | }
1610 | },
1611 | "type": "object"
1612 | }
1613 | }
1614 | }
1615 |
--------------------------------------------------------------------------------