Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new lsp options. #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,18 @@ export function activate(context) {
args.push("--send-crash-reports");
}
if (config.get("log.path") != "") {
args.push("--log-path " + config.get("log.path"));
args.push("--log-path=" + config.get("log.path"));
}
if (config.get("version") != "") {
args.push("--lang-version " + config.get("version"));
args.push("--lang-version=" + config.get("version"));
}
if (config.get('c3.path')) {
args.push('--c3c-path='+config.get('c3.path'));
}
if (config.get('diagnosticsDelay')) {
args.push('--diagnostics-delay='+config.get('diagnosticsDelay'));
}

const serverOptions = {
run: {
command: executablePath,
Expand All @@ -62,7 +69,7 @@ export function activate(context) {
const clientOptions = {
documentSelector: [{ scheme: "file", language: "c3" }],
synchronize: {
fileEvents: workspace.createFileSystemWatcher("**/*.c3"),
fileEvents: workspace.createFileSystemWatcher('**/*.{c3,c3i}'),
},
};

Expand All @@ -73,6 +80,8 @@ export function activate(context) {
client.start();
}
export function deactivate() {
if (!client) {
return undefined;
}
return client.stop();

}
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@
"type": "string",
"default": "",
"markdownDescription": "Specify C3 language version. If omited, LSP will use the last version it supports."
},
"c3.lsp.diagnosticsDelay": {
"type": "integer",
"default": 2000,
"markdownDescription": "Delay calculation of code diagnostics after modifications in source. In milliseconds, default 2000 ms."
},
"c3.lsp.c3.path": {
"type": "string",
"default": null,
"markdownDescription": "Path to C3C binary. Use it if not defined already in your PATH environment variable or if you want to use a different one."
}
}
}
Expand Down