@@ -122,34 +122,15 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
122122 }
123123 } ) ) ;
124124
125- const htmlRegex = / c l a s s = [ " | ' ] ( [ \w - ] * $ ) / ;
126- const jsxRegex = / c l a s s N a m e = [ " | ' ] ( [ \w - ] * $ ) / ;
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 ) ;
125+ // Javascript based extensions
126+ [ 'typescriptreact' , 'javascript' , 'javascriptreact' ] . forEach ( ( extension ) => {
127+ context . subscriptions . push ( provideCompletionItemsGenerator ( extension , / c l a s s N a m e = [ " | ' ] ( [ \w - ] * $ ) / ) ) ;
128+ } ) ;
129+
130+ // HTML based extensions
131+ [ 'html' , 'razor' , 'php' , 'blade' , 'vue' , 'twig' , 'markdown' , 'erb' , 'handlebars' , 'ejs' ] . forEach ( ( extension ) => {
132+ context . subscriptions . push ( provideCompletionItemsGenerator ( extension , / c l a s s = [ " | ' ] ( [ \w - ] * $ ) / ) ) ;
133+ } ) ;
153134
154135 caching = true ;
155136 try {
0 commit comments