MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / inferThemeFromName

Function inferThemeFromName

cli/src/utils/theme-system.ts:164–180  ·  view source on GitHub ↗
(themeName: string)

Source from the content-addressed store, hash-verified

162 themeName.trim().toLowerCase()
163
164const inferThemeFromName = (themeName: string): ThemeName | null => {
165 const normalized = normalizeThemeName(themeName)
166
167 for (const hint of IDE_THEME_INFERENCE.dark) {
168 if (normalized.includes(hint)) {
169 return 'dark'
170 }
171 }
172
173 for (const hint of IDE_THEME_INFERENCE.light) {
174 if (normalized.includes(hint)) {
175 return 'light'
176 }
177 }
178
179 return null
180}
181
182const stripJsonStyleComments = (raw: string): string =>
183 raw.replace(/\/\*[\s\S]*?\*\//g, '').replace(/^\s*\/\/.*$/gm, '')

Callers 2

extractVSCodeThemeFunction · 0.85
extractZedThemeFunction · 0.85

Calls 1

normalizeThemeNameFunction · 0.85

Tested by

no test coverage detected