-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixup build and IDE config usage (#55)
- Loading branch information
1 parent
aad9599
commit 826f3ef
Showing
9 changed files
with
196 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//* IDE-specific config functions | ||
|
||
import * as vscode from 'vscode'; | ||
import { CfgKey, configPrefix } from '../../util/src/config'; | ||
|
||
/** Get the root config object currently persisted in the IDE */ | ||
export function getConfigRoot() { | ||
return vscode.workspace.getConfiguration(configPrefix); | ||
} | ||
|
||
/** Get the config value currently persisted in the IDE */ | ||
export function getConfigIDE<T = unknown>( | ||
key: CfgKey, | ||
defaultValue: T, | ||
): typeof defaultValue { | ||
const rawResult = getConfigRoot().get<T>(key); | ||
if (rawResult === undefined) return defaultValue; | ||
return rawResult; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.