Skip to content

Commit ad61495

Browse files
authored
Merge pull request #764 from jupyter-lsp/fix-schema
Fix/improve schema for settings editor
2 parents 4ca2dba + dec3433 commit ad61495

File tree

5 files changed

+43
-34
lines changed

5 files changed

+43
-34
lines changed

packages/jupyterlab-lsp/schema/completion.json

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@
4242
"description": "The time to wait for the kernel completions suggestions in milliseconds. Set to 0 to disable kernel completions, or to -1 to wait indefinitely (not recommended)."
4343
},
4444
"disableCompletionsFrom": {
45+
"title": "Disable completions by source",
4546
"description": "The sources from which to exclude completion from. Possible values include 'Kernel', 'LSP'.",
4647
"type": "array",
48+
"items": {
49+
"type": "string",
50+
"enum": ["Kernel", "LSP"]
51+
},
4752
"default": [],
4853
"uniqueItems": true
4954
},
@@ -62,6 +67,7 @@
6267
"kernelCompletionsFirst": {
6368
"title": "Prioritize completions from kernel",
6469
"default": false,
70+
"type": "boolean",
6571
"description": "In case of ties when sorting completions, should the kernel completions receive higher priority than the language server completions?"
6672
},
6773
"caseSensitive": {
@@ -110,38 +116,36 @@
110116
"undefinitializer": "Constant",
111117
"base.devnull": "Constant"
112118
},
113-
"patternProperties": {
114-
"^.*$": {
115-
"type": "string",
116-
"enum": [
117-
"Kernel",
118-
"Text",
119-
"Method",
120-
"Function",
121-
"Constructor",
122-
"Field",
123-
"Variable",
124-
"Class",
125-
"Interface",
126-
"Module",
127-
"Property",
128-
"Unit",
129-
"Value",
130-
"Enum",
131-
"Keyword",
132-
"Snippet",
133-
"Color",
134-
"File",
135-
"Reference",
136-
"Folder",
137-
"EnumMember",
138-
"Constant",
139-
"Struct",
140-
"Event",
141-
"Operator",
142-
"TypeParameter"
143-
]
144-
}
119+
"additionalProperties": {
120+
"type": "string",
121+
"enum": [
122+
"Kernel",
123+
"Text",
124+
"Method",
125+
"Function",
126+
"Constructor",
127+
"Field",
128+
"Variable",
129+
"Class",
130+
"Interface",
131+
"Module",
132+
"Property",
133+
"Unit",
134+
"Value",
135+
"Enum",
136+
"Keyword",
137+
"Snippet",
138+
"Color",
139+
"File",
140+
"Reference",
141+
"Folder",
142+
"EnumMember",
143+
"Constant",
144+
"Struct",
145+
"Event",
146+
"Operator",
147+
"TypeParameter"
148+
]
145149
}
146150
},
147151
"disable": {

packages/jupyterlab-lsp/schema/highlights.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"title": "Debouncer delay",
1010
"type": "number",
1111
"default": 250,
12+
"minimum": 0,
1213
"description": "Number of milliseconds to delay sending out the highlights request to the language server; you can get better responsiveness adjusting this value, but setting it to zero can actually slow it down as the server might get overwhelmed when moving the cursor."
1314
},
1415
"removeOnBlur": {

packages/jupyterlab-lsp/schema/hover.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
"title": "Throttler delay",
1717
"type": "number",
1818
"default": 50,
19+
"minimum": 0,
1920
"description": "Number of milliseconds to delay sending out the hover request to the language server; you can get better responsiveness adjusting this value, but setting it to zero can actually slow it down as the server might get overwhelmed when moving the mouse over the code."
2021
},
2122
"cacheSize": {
2223
"title": "Cache size",
2324
"type": "number",
2425
"default": 25,
26+
"minimum": 0,
2527
"description": "Up to how many hover responses should be cached at any given time. The cache being is invalidated after any change in the editor."
2628
},
2729
"disable": {

packages/jupyterlab-lsp/schema/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"type": "object",
77
"definitions": {
88
"language-server": {
9-
"title": "Language Server",
109
"description": "Client and server configurations for a single language server",
1110
"type": "object",
1211
"default": {},
@@ -15,7 +14,8 @@
1514
"title": "Language Server Configurations",
1615
"description": "Configuration to be sent to language server over LSP when initialized: see the specific language server's documentation for more",
1716
"type": "object",
18-
"default": {}
17+
"default": {},
18+
"additionalProperties": true
1919
},
2020
"priority": {
2121
"title": "Priority of the server",

packages/jupyterlab-lsp/schema/syntax_highlighting.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"title": "Threshold of foreign code coverage for changing the mode in an editor",
1010
"type": "number",
1111
"default": 0.5,
12+
"minimum": 0,
13+
"maximum": 1,
1214
"description": "If a code editor includes a code fragment in another language (for example a %%markdown magic in IPython) with appropriate foreign code extractor defined, and the extend of this code (coverage of the editor) passes the threshold, the syntax highlighting (i.e. the mode) will change to provide highlighting for the language of the foreign code."
1315
},
1416
"disable": {

0 commit comments

Comments
 (0)