Skip to content

Commit 9a21cde

Browse files
feat: add more custom languages
#103
1 parent a1ca9d0 commit 9a21cde

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

src/utils/filetypes.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,24 @@ if (getConfig('windicss.includeLanguages')) {
9999
const config = getConfig<object>('windicss.includeLanguages')!;
100100
// console.log(config)
101101
for (const [key, value] of Object.entries(config)) {
102+
let patterns
103+
switch (value) {
104+
case "html":
105+
patterns = htmlPatterns.concat(stylesPatterns, attributePatterns)
106+
break;
107+
108+
case "js":
109+
patterns = jsPatterns
110+
111+
case "css":
112+
patterns = stylesPatterns
113+
114+
default:
115+
patterns = stylesPatterns
116+
}
102117
fileTypes.push({
103118
extension: key,
104-
patterns: (value === 'html') ? htmlPatterns.concat(stylesPatterns, attributePatterns) : jsPatterns,
119+
patterns
105120
});
106121
}
107-
// Log.info('fileMap: ' + JSON.stringify(fileTypes));
108-
}
122+
}

0 commit comments

Comments
 (0)