MCPcopy Create free account
hub / github.com/continuedev/continue / setTheme

Method setTheme

core/codeRenderer/CodeRenderer.ts:71–96  ·  view source on GitHub ↗
(themeName: string)

Source from the content-addressed store, hash-verified

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

Callers 2

setupListenersMethod · 0.80

Calls 2

themeExistsMethod · 0.95
kebabOfThemeStrFunction · 0.90

Tested by

no test coverage detected