Skip to content

Commit 44c2a02

Browse files
author
Travis James Smith
committed
Change settings key to better reflect language-server configuration messages
1 parent ab923bc commit 44c2a02

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
**/lib
1010
**/node_modules
1111
**/package.json
12+
**/plugin.json
1213
**/static
1314
atest
1415
coverage

packages/jupyterlab-lsp/schema/plugin.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"type": "object",
2626
"default": {},
2727
"properties": {
28-
"config": {
29-
"title": "Language Server Configuration",
28+
"settings": {
29+
"title": "Language Server Settings",
3030
"description": "Configuration to be sent to language server over LSP when initialized: see the specific language server's documentation for more",
3131
"type": "object",
3232
"default": {}
@@ -37,23 +37,31 @@
3737
"jupyter.lab.shortcuts": [
3838
{
3939
"command": "lsp:jump-to-definition-notebook",
40-
"keys": ["Accel B"],
40+
"keys": [
41+
"Accel B"
42+
],
4143
"selector": ".jp-Notebook .jp-CodeCell"
4244
},
4345
{
4446
"command": "lsp:jump-to-definition-file_editor",
45-
"keys": ["Accel B"],
47+
"keys": [
48+
"Accel B"
49+
],
4650
"selector": ".jp-FileEditor"
4751
},
4852
{
4953
"command": "lsp:rename-symbol-notebook",
50-
"keys": ["F2"],
54+
"keys": [
55+
"F2"
56+
],
5157
"selector": ".jp-Notebook .jp-CodeCell"
5258
},
5359
{
5460
"command": "lsp:rename-symbol-file_editor'",
55-
"keys": ["F2"],
61+
"keys": [
62+
"F2"
63+
],
5664
"selector": ".jp-FileEditor"
5765
}
5866
]
59-
}
67+
}

packages/jupyterlab-lsp/src/connection_manager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ export class DocumentConnectionManager {
150150

151151
public async updateServerConfigurations(
152152
//TODO: define types for server configurations
153-
settings: any
153+
allSettings: any
154154
) {
155155
console.log(this.language_server_manager)
156-
for (let language_server_id in settings) {
157-
const config = settings[language_server_id].config
158-
await Private.updateServerConfiguration(language_server_id, config)
156+
for (let language_server_id in allSettings) {
157+
const serverSettings = allSettings[language_server_id]
158+
await Private.updateServerConfiguration(language_server_id, serverSettings)
159159
}
160160
}
161161

packages/jupyterlab-lsp/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ const plugin: JupyterFrontEndPlugin<void> = {
244244
// CodeMirrorExtension.modifierKey = modifier;
245245
// }
246246
// });
247-
248247
const languageServerSettings = options.language_servers || {};
249248
connection_manager.updateServerConfigurations(languageServerSettings);
250249
}

packages/lsp-ws-connection/src/ws-connection.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,19 @@ export class LspWsConnection extends events.EventEmitter
270270

271271
public sendConfigurationChange(
272272
//TODO: define types for server configurations
273-
options: any
273+
settings: any
274274
) {
275-
console.log(`Updated server configuration: ${JSON.stringify(options)}`)
275+
console.log(
276+
`Updated server configuration: ${JSON.stringify(settings)}`
277+
);
276278
if (!this.isReady) {
277279
return;
278280
}
279281

280282
this.connection.sendNotification(
281283
'workspace/didChangeConfiguration',
282-
options
283-
)
284+
settings
285+
);
284286
}
285287

286288
public async getHoverTooltip(

0 commit comments

Comments
 (0)