|
1 | | -import { ExtensionContext } from "vscode"; |
| 1 | +import { ExtensionContext } from 'vscode'; |
2 | 2 |
|
3 | 3 | import { |
4 | | - Executable, |
5 | | - LanguageClient, |
6 | | - LanguageClientOptions, |
7 | | - ServerOptions, |
8 | | -} from "vscode-languageclient/node"; |
| 4 | + Executable, |
| 5 | + LanguageClient, |
| 6 | + LanguageClientOptions, |
| 7 | + ServerOptions, |
| 8 | +} from 'vscode-languageclient/node'; |
9 | 9 |
|
10 | 10 | let client: LanguageClient; |
11 | 11 |
|
12 | 12 | export function activate(context: ExtensionContext) { |
13 | | - // If the extension is launched in debug mode then the debug server options are used |
14 | | - // Otherwise the run options are used |
15 | | - const run: Executable = { |
16 | | - command: "pglsp", |
17 | | - }; |
18 | | - const serverOptions: ServerOptions = { |
19 | | - run, |
20 | | - debug: run, |
21 | | - }; |
| 13 | + // If the extension is launched in debug mode then the debug server options are used |
| 14 | + // Otherwise the run options are used |
| 15 | + const run: Executable = { |
| 16 | + command: 'pglsp', |
| 17 | + }; |
| 18 | + const serverOptions: ServerOptions = { |
| 19 | + run, |
| 20 | + debug: run, |
| 21 | + }; |
22 | 22 |
|
23 | | - // Options to control the language client |
24 | | - const clientOptions: LanguageClientOptions = { |
25 | | - // Register the server for plain text documents |
26 | | - documentSelector: [{ scheme: "file", language: "sql" }], |
27 | | - }; |
| 23 | + // Options to control the language client |
| 24 | + const clientOptions: LanguageClientOptions = { |
| 25 | + // Register the server for plain text documents |
| 26 | + documentSelector: [{ scheme: 'file', language: 'sql' }], |
| 27 | + }; |
28 | 28 |
|
29 | | - // Create the language client and start the client. |
30 | | - client = new LanguageClient("postgres_lsp", "Postgres LSP", serverOptions, clientOptions); |
| 29 | + // Create the language client and start the client. |
| 30 | + client = new LanguageClient('postgres_lsp', 'Postgres LSP', serverOptions, clientOptions); |
31 | 31 |
|
32 | | - // Start the client. This will also launch the server |
33 | | - client.start(); |
| 32 | + // Start the client. This will also launch the server |
| 33 | + client.start(); |
34 | 34 | } |
35 | 35 |
|
36 | 36 | export function deactivate(): Thenable<void> | undefined { |
37 | | - if (!client) { |
38 | | - return undefined; |
39 | | - } |
40 | | - return client.stop(); |
| 37 | + if (!client) { |
| 38 | + return undefined; |
| 39 | + } |
| 40 | + return client.stop(); |
41 | 41 | } |
0 commit comments