Skip to content

Commit

Permalink
Fix issue with configuration changes requiring a reload
Browse files Browse the repository at this point in the history
  • Loading branch information
DaelonSuzuka committed Oct 27, 2023
1 parent 1a09ae4 commit 8b16dd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/lsp/ClientConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export class ClientConnectionManager {
this.target = TargetLSP.EDITOR;
this.connectedVersion = undefined;

// TODO: why does changing lsp.headless require reloading vscode?
if (get_configuration("lsp.headless")) {
this.target = TargetLSP.HEADLESS;
await this.start_language_server();
Expand Down
6 changes: 2 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ import { AddressInfo, createServer } from "net";

const EXTENSION_PREFIX = "godotTools";

const config = vscode.workspace.getConfiguration(EXTENSION_PREFIX);

export function get_configuration(name: string, default_value?: any) {
let config_value = config.get(name, null);
let config_value = vscode.workspace.getConfiguration(EXTENSION_PREFIX).get(name, null);
if (default_value && config_value === null) {
return default_value;
}
return config_value;
}

export function set_configuration(name: string, value: any) {
return config.update(name, value);
return vscode.workspace.getConfiguration(EXTENSION_PREFIX).update(name, value);
}

export function is_debug_mode(): boolean {
Expand Down

0 comments on commit 8b16dd4

Please sign in to comment.