Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
add Settings enum and getConfig() to config.ts for evidence settings …
Browse files Browse the repository at this point in the history
…lookup (#52)
  • Loading branch information
RandomFractals committed Jun 1, 2023
1 parent b1ad1b9 commit ebb86ff
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ import {

import { Commands } from './commands/commands';

/**
* VSCode and Evidence extension settings.
*/
export const enum Settings {
// eslint-disable-next-line @typescript-eslint/naming-convention
DefaultPort = 'defaultPort'
}

/**
* Gets Evidence extension configuration setting.
*
* @param settingName Configuration setting name.
* @param defaultValue Optional efault setting value to use when not found.
* @returns
*/
export function getConfig<T>(settingName: string, defaultValue?: T) {
return workspace.getConfiguration().get(`evidence.${settingName}`, defaultValue);
}

/**
* Updates Evidence project context values
* to show available Evidence project commands in Command Palette.
Expand Down

0 comments on commit ebb86ff

Please sign in to comment.