forked from smithy-lang/smithy-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
29 lines (22 loc) · 928 Bytes
/
config.ts
File metadata and controls
29 lines (22 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import * as vscode from 'vscode';
export function getServerDiagnosticsMinimumSeverity(): string | undefined {
return getOldOrNewConfig('diagnostics.minimumSeverity', 'server.diagnostics.minimumSeverity');
}
export function getServerOnlyReloadOnSave(): boolean | undefined {
return getOldConfig('onlyReloadOnSave');
}
export function getServerExecutable(): string | undefined {
return getConfig('server.executable');
}
export function getServerVersion(): string {
return getOldOrNewConfig('version', 'server.version');
}
function getOldOrNewConfig<T>(oldKey: string, newKey: string): T | undefined {
return getOldConfig(oldKey) || getConfig(newKey);
}
function getConfig<T>(key: string): T | undefined {
return vscode.workspace.getConfiguration('smithy').get<T>(key);
}
function getOldConfig<T>(key: string): T | undefined {
return vscode.workspace.getConfiguration('smithyLsp').get<T>(key);
}