@@ -125,31 +125,26 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
125
125
const htmlRegex = / c l a s s = [ " | ' ] ( [ \w - ] * $ ) / ;
126
126
const jsxRegex = / c l a s s N a m e = [ " | ' ] ( [ \w - ] * $ ) / ;
127
127
128
- const html = provideCompletionItemsGenerator ( 'html' , htmlRegex ) ;
129
- const razor = provideCompletionItemsGenerator ( 'razor' , htmlRegex ) ;
130
- const php = provideCompletionItemsGenerator ( 'php' , htmlRegex ) ;
131
- const vue = provideCompletionItemsGenerator ( 'vue' , htmlRegex ) ;
132
- const twig = provideCompletionItemsGenerator ( 'twig' , htmlRegex ) ;
133
- const md = provideCompletionItemsGenerator ( 'markdown' , htmlRegex ) ;
134
- const tsReact = provideCompletionItemsGenerator ( 'typescriptreact' , jsxRegex ) ;
135
- const js = provideCompletionItemsGenerator ( 'javascript' , jsxRegex )
136
- const jsReact = provideCompletionItemsGenerator ( 'javascriptreact' , jsxRegex ) ;
137
- const erb = provideCompletionItemsGenerator ( 'erb' , htmlRegex ) ;
138
- const hbs = provideCompletionItemsGenerator ( 'handlebars' , htmlRegex ) ;
139
- const ejs = provideCompletionItemsGenerator ( 'ejs' , htmlRegex ) ;
140
-
141
- context . subscriptions . push ( html ) ;
142
- context . subscriptions . push ( razor ) ;
143
- context . subscriptions . push ( php ) ;
144
- context . subscriptions . push ( vue ) ;
145
- context . subscriptions . push ( twig ) ;
146
- context . subscriptions . push ( md ) ;
147
- context . subscriptions . push ( tsReact ) ;
148
- context . subscriptions . push ( js ) ;
149
- context . subscriptions . push ( jsReact ) ;
150
- context . subscriptions . push ( erb ) ;
151
- context . subscriptions . push ( hbs ) ;
152
- context . subscriptions . push ( ejs ) ;
128
+ const extensions = [
129
+ 'html' ,
130
+ 'razor' ,
131
+ 'php' ,
132
+ 'vue' ,
133
+ 'twig' ,
134
+ 'markdown' ,
135
+ 'typescriptreact' ,
136
+ 'javascript' ,
137
+ 'javascriptreact' ,
138
+ 'erb' ,
139
+ 'handlebars' ,
140
+ 'ejs'
141
+ ] ;
142
+
143
+ extensions . forEach ( ( extension ) => {
144
+ context . subscriptions . push (
145
+ provideCompletionItemsGenerator ( extension , htmlRegex )
146
+ ) ;
147
+ } ) ;
153
148
154
149
caching = true ;
155
150
try {
0 commit comments