|
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: 'postgres_lsp', |
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( |
31 |
| - 'postgres_lsp', |
32 |
| - 'Postgres LSP', |
33 |
| - serverOptions, |
34 |
| - clientOptions |
35 |
| - ); |
| 29 | + // Create the language client and start the client. |
| 30 | + client = new LanguageClient("postgres_lsp", "Postgres LSP", serverOptions, clientOptions); |
36 | 31 |
|
37 |
| - // Start the client. This will also launch the server |
38 |
| - client.start(); |
| 32 | + // Start the client. This will also launch the server |
| 33 | + client.start(); |
39 | 34 | }
|
40 | 35 |
|
41 | 36 | export function deactivate(): Thenable<void> | undefined {
|
42 |
| - if (!client) { |
43 |
| - return undefined; |
44 |
| - } |
45 |
| - return client.stop(); |
| 37 | + if (!client) { |
| 38 | + return undefined; |
| 39 | + } |
| 40 | + return client.stop(); |
46 | 41 | }
|
0 commit comments