aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/server.ts')
-rw-r--r--editors/code/src/server.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts
index 01fd80756..196fc3ebc 100644
--- a/editors/code/src/server.ts
+++ b/editors/code/src/server.ts
@@ -8,24 +8,26 @@ export class Server {
8 public static config = new Config(); 8 public static config = new Config();
9 public static client: lc.LanguageClient; 9 public static client: lc.LanguageClient;
10 10
11 public static start(notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]>) { 11 public static start(
12 notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]>
13 ) {
12 const run: lc.Executable = { 14 const run: lc.Executable = {
13 command: 'ra_lsp_server', 15 command: 'ra_lsp_server',
14 options: { cwd: '.' }, 16 options: { cwd: '.' }
15 }; 17 };
16 const serverOptions: lc.ServerOptions = { 18 const serverOptions: lc.ServerOptions = {
17 run, 19 run,
18 debug: run, 20 debug: run
19 }; 21 };
20 const clientOptions: lc.LanguageClientOptions = { 22 const clientOptions: lc.LanguageClientOptions = {
21 documentSelector: [{ scheme: 'file', language: 'rust' }], 23 documentSelector: [{ scheme: 'file', language: 'rust' }]
22 }; 24 };
23 25
24 Server.client = new lc.LanguageClient( 26 Server.client = new lc.LanguageClient(
25 'ra-lsp', 27 'ra-lsp',
26 'rust-analyzer languge server', 28 'rust-analyzer languge server',
27 serverOptions, 29 serverOptions,
28 clientOptions, 30 clientOptions
29 ); 31 );
30 Server.client.onReady().then(() => { 32 Server.client.onReady().then(() => {
31 for (const [type, handler] of notificationHandlers) { 33 for (const [type, handler] of notificationHandlers) {