@@ -107,8 +107,8 @@ class ClassServer implements vsc.CompletionItemProvider {
107107
108108 private regex = [
109109 / ( c l a s s | i d ) = [ " | ' ] ( [ ^ " ^ ' ] * $ ) / i,
110- / < s t y l e [ \s \S ] * > ( [ \s \S ] * ) < \/ s t y l e > / ig ,
111- / ( \. | \# ) [ ^ \. ^ \# ^ \< ^ \> ] * $ / i
110+ / ( \. | \# ) [ ^ \. ^ \# ^ \< ^ \> ] * $ / i ,
111+ / < s t y l e [ \s \S ] * > ( [ \s \S ] * ) < \/ s t y l e > / ig
112112 ] ;
113113
114114 provideCompletionItems ( document : vsc . TextDocument , position : vsc . Position , token : vsc . CancellationToken ) : vsc . CompletionList {
@@ -118,12 +118,12 @@ class ClassServer implements vsc.CompletionItemProvider {
118118
119119 let tag = this . regex [ 0 ] . exec ( text ) ;
120120 if ( ! tag ) {
121- tag = this . regex [ 2 ] . exec ( text ) ;
121+ tag = this . regex [ 1 ] . exec ( text ) ;
122122 }
123123 if ( tag ) {
124124 let internal : lst . SymbolInformation [ ] = [ ] ;
125125 let style ;
126- while ( style = this . regex [ 1 ] . exec ( document . getText ( ) ) ) {
126+ while ( style = this . regex [ 2 ] . exec ( document . getText ( ) ) ) {
127127 let snippet = new Snippet ( style [ 1 ] ) ;
128128 let symbols = service . findDocumentSymbols ( snippet . document , snippet . stylesheet ) ;
129129 for ( let symbol of symbols ) {
@@ -232,12 +232,18 @@ export function activate(context: vsc.ExtensionContext) {
232232 context . subscriptions . push ( vsc . languages . registerCompletionItemProvider (
233233 [ 'html' , 'laravel-blade' , 'razor' ] , classServer ) ) ;
234234
235+ let wp = / ( - ? \d * \. \d \w * ) | ( [ ^ \` \~ \! \@ \# \% \^ \& \* \( \) \= \+ \[ \{ \] \} \\ \| \; \: \' \. \" \, \< \> \/ \? \s ] + ) / g;
236+
237+ context . subscriptions . push ( vsc . languages . setLanguageConfiguration ( 'html' , {
238+ wordPattern : wp
239+ } ) ) ;
240+
235241 context . subscriptions . push ( vsc . languages . setLanguageConfiguration ( 'laravel-blade' , {
236- wordPattern : / ( - ? \d * \. \d \w * ) | ( [ ^ \` \~ \! \@ \# \% \^ \& \* \( \) \= \+ \[ \{ \] \} \\ \| \; \: \' \. \" \, \< \> \/ \? \s ] + ) / g
242+ wordPattern : wp
237243 } ) ) ;
238244
239245 context . subscriptions . push ( vsc . languages . setLanguageConfiguration ( 'razor' , {
240- wordPattern : / ( - ? \d * \. \d \w * ) | ( [ ^ \` \~ \! \@ \# \% \^ \& \* \( \) \= \+ \[ \{ \] \} \\ \| \; \: \' \. \" \, \< \> \/ \? \s ] + ) / g
246+ wordPattern : wp
241247 } ) ) ;
242248}
243249
0 commit comments