diff options
author | Laurențiu Nicola <[email protected]> | 2019-12-09 18:57:55 +0000 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2019-12-09 19:07:19 +0000 |
commit | 273299693b85996878907ad256ed55f072ec3f1a (patch) | |
tree | 16d7de77952895b4cebf1cbb7a18652eaf4d98b6 /editors/code/src/server.ts | |
parent | 897b550049d8889804bb476e305427d07879cd63 (diff) |
Code: enable prettier trailing commas
Diffstat (limited to 'editors/code/src/server.ts')
-rw-r--r-- | editors/code/src/server.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts index e767b6f1b..2fe45f1ed 100644 --- a/editors/code/src/server.ts +++ b/editors/code/src/server.ts | |||
@@ -19,7 +19,7 @@ export class Server { | |||
19 | public static client: lc.LanguageClient; | 19 | public static client: lc.LanguageClient; |
20 | 20 | ||
21 | public static async start( | 21 | public static async start( |
22 | notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]> | 22 | notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]>, |
23 | ) { | 23 | ) { |
24 | // '.' Is the fallback if no folder is open | 24 | // '.' Is the fallback if no folder is open |
25 | // TODO?: Workspace folders support Uri's (eg: file://test.txt). It might be a good idea to test if the uri points to a file. | 25 | // TODO?: Workspace folders support Uri's (eg: file://test.txt). It might be a good idea to test if the uri points to a file. |
@@ -34,20 +34,20 @@ export class Server { | |||
34 | if (platform() !== 'win32') { | 34 | if (platform() !== 'win32') { |
35 | if (!(await lookpath(command))) { | 35 | if (!(await lookpath(command))) { |
36 | throw new Error( | 36 | throw new Error( |
37 | `Cannot find rust-analyzer server \`${command}\` in PATH.` | 37 | `Cannot find rust-analyzer server \`${command}\` in PATH.`, |
38 | ); | 38 | ); |
39 | } | 39 | } |
40 | } | 40 | } |
41 | const run: lc.Executable = { | 41 | const run: lc.Executable = { |
42 | command, | 42 | command, |
43 | options: { cwd: folder } | 43 | options: { cwd: folder }, |
44 | }; | 44 | }; |
45 | const serverOptions: lc.ServerOptions = { | 45 | const serverOptions: lc.ServerOptions = { |
46 | run, | 46 | run, |
47 | debug: run | 47 | debug: run, |
48 | }; | 48 | }; |
49 | const traceOutputChannel = window.createOutputChannel( | 49 | const traceOutputChannel = window.createOutputChannel( |
50 | 'Rust Analyzer Language Server Trace' | 50 | 'Rust Analyzer Language Server Trace', |
51 | ); | 51 | ); |
52 | const clientOptions: lc.LanguageClientOptions = { | 52 | const clientOptions: lc.LanguageClientOptions = { |
53 | documentSelector: [{ scheme: 'file', language: 'rust' }], | 53 | documentSelector: [{ scheme: 'file', language: 'rust' }], |
@@ -58,16 +58,16 @@ export class Server { | |||
58 | excludeGlobs: Server.config.excludeGlobs, | 58 | excludeGlobs: Server.config.excludeGlobs, |
59 | useClientWatching: Server.config.useClientWatching, | 59 | useClientWatching: Server.config.useClientWatching, |
60 | featureFlags: Server.config.featureFlags, | 60 | featureFlags: Server.config.featureFlags, |
61 | withSysroot: Server.config.withSysroot | 61 | withSysroot: Server.config.withSysroot, |
62 | }, | 62 | }, |
63 | traceOutputChannel | 63 | traceOutputChannel, |
64 | }; | 64 | }; |
65 | 65 | ||
66 | Server.client = new lc.LanguageClient( | 66 | Server.client = new lc.LanguageClient( |
67 | 'rust-analyzer', | 67 | 'rust-analyzer', |
68 | 'Rust Analyzer Language Server', | 68 | 'Rust Analyzer Language Server', |
69 | serverOptions, | 69 | serverOptions, |
70 | clientOptions | 70 | clientOptions, |
71 | ); | 71 | ); |
72 | // HACK: This is an awful way of filtering out the decorations notifications | 72 | // HACK: This is an awful way of filtering out the decorations notifications |
73 | // However, pending proper support, this is the most effecitve approach | 73 | // However, pending proper support, this is the most effecitve approach |
@@ -80,10 +80,10 @@ export class Server { | |||
80 | if (typeof messageOrDataObject === 'string') { | 80 | if (typeof messageOrDataObject === 'string') { |
81 | if ( | 81 | if ( |
82 | messageOrDataObject.includes( | 82 | messageOrDataObject.includes( |
83 | 'rust-analyzer/publishDecorations' | 83 | 'rust-analyzer/publishDecorations', |
84 | ) || | 84 | ) || |
85 | messageOrDataObject.includes( | 85 | messageOrDataObject.includes( |
86 | 'rust-analyzer/decorationsRequest' | 86 | 'rust-analyzer/decorationsRequest', |
87 | ) | 87 | ) |
88 | ) { | 88 | ) { |
89 | // Don't log publish decorations requests | 89 | // Don't log publish decorations requests |
@@ -95,7 +95,7 @@ export class Server { | |||
95 | // @ts-ignore | 95 | // @ts-ignore |
96 | Server.client.logObjectTrace(messageOrDataObject); | 96 | Server.client.logObjectTrace(messageOrDataObject); |
97 | } | 97 | } |
98 | } | 98 | }, |
99 | }; | 99 | }; |
100 | Server.client.registerProposedFeatures(); | 100 | Server.client.registerProposedFeatures(); |
101 | Server.client.onReady().then(() => { | 101 | Server.client.onReady().then(() => { |