(themeName: string)
| 69 | } |
| 70 | |
| 71 | public async setTheme(themeName: string): Promise<void> { |
| 72 | if ( |
| 73 | this.themeExists(kebabOfThemeStr(themeName)) || |
| 74 | themeName === "Default Dark Modern" |
| 75 | ) { |
| 76 | this.currentTheme = |
| 77 | themeName === "Default Dark Modern" |
| 78 | ? "dark-plus" |
| 79 | : kebabOfThemeStr(themeName); |
| 80 | } else { |
| 81 | // Fallback to default theme for unsupported themes. |
| 82 | this.currentTheme = "dark-plus"; |
| 83 | } |
| 84 | |
| 85 | // Always initialize the highlighter with the current theme. |
| 86 | this.highlighter = await getSingletonHighlighter({ |
| 87 | langs: ["typescript"], |
| 88 | themes: [this.currentTheme], |
| 89 | }); |
| 90 | |
| 91 | const th = this.highlighter.getTheme(this.currentTheme); |
| 92 | this.editorBackground = th.bg; |
| 93 | this.editorForeground = th.fg; |
| 94 | this.editorLineHighlight = |
| 95 | th.colors!["editor.lineHighlightBackground"] ?? "#000000"; |
| 96 | } |
| 97 | |
| 98 | async init(): Promise<void> {} |
| 99 |
no test coverage detected