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

chore: Add option to disable LSP #180

Merged
merged 1 commit into from
Apr 18, 2024
Merged
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
4 changes: 4 additions & 0 deletions client/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export class Config {
return this.get<string>('diagnostic.binPath');
}

get disableLsp() {
return this.get<string>('diagnostic.disableLsp');
}

get traceExtension() {
return this.get<boolean>('trace.extension');
}
Expand Down
5 changes: 5 additions & 0 deletions client/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export async function activate(context: ExtensionContext) {
// Start a recurring task to keep fuel-core status updated
setInterval(updateFuelCoreStatus, 1000);

if (config.disableLsp) {
log.info('Sway Language Server is disabled. Exiting...');
return;
}

// Listen for did_change events for on_enter capabilities.
workspace.onDidChangeTextDocument(
async changeEvent => await onEnter(changeEvent)
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@
"default": "",
"pattern": "(^\/(.+\/)*forc-lsp$)|^$",
"patternErrorMessage": "Must be an absolute path to the `forc-lsp` executable, or left empty."
},
},
"sway-lsp.diagnostic.disableLsp": {
"description": "Disable the LSP server. This will disable all language features except for basic syntax highlighting.",
"type": "boolean",
"default": false
},
"sway-lsp.logging.level": {
"scope": "window",
"type": "string",
Expand Down
Loading