Skip to content

Commit b59c83c

Browse files
fix: extension command, server crate path
1 parent d76481b commit b59c83c

File tree

2 files changed

+29
-34
lines changed

2 files changed

+29
-34
lines changed

editors/code/src/main.ts

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
1-
import { ExtensionContext } from 'vscode';
1+
import { ExtensionContext } from "vscode";
22

33
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";
99

1010
let client: LanguageClient;
1111

1212
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+
};
2222

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+
};
2828

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);
3631

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();
3934
}
4035

4136
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();
4641
}

xtask/src/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn install_client(sh: &Shell, client_opt: ClientOpt) -> anyhow::Result<()> {
139139
fn install_server(sh: &Shell) -> anyhow::Result<()> {
140140
let cmd = cmd!(
141141
sh,
142-
"cargo install --path crates/postgres_lsp --locked --force"
142+
"cargo install --path crates/pg_lsp --locked --force"
143143
);
144144
cmd.run()?;
145145
Ok(())

0 commit comments

Comments
 (0)