Skip to content

Commit 19b0de7

Browse files
authored
Merge pull request #60 from CodinGame/improve-set-theme
Allow to provide path and uiTheme to setTheme function
2 parents c04fc5b + a821af3 commit 19b0de7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/theme/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ function updateThemes () {
4343
}
4444
updateThemes()
4545

46-
function defineVSCodeTheme (id: string, load: () => Promise<string>): Disposable {
46+
function defineVSCodeTheme (idOrTheme: string | Pick<IThemeExtensionPoint, 'id' | 'label' | 'description' | 'uiTheme' | 'path'>, load: () => Promise<string>): Disposable {
4747
const theme: VSCodeTheme = {
48-
id,
49-
path: `/${id}.json`,
48+
...(typeof idOrTheme === 'string' ? { id: idOrTheme, path: `/${idOrTheme}.json` } : idOrTheme),
5049
load,
5150
_watch: false
5251
}

0 commit comments

Comments
 (0)