File tree 1 file changed +8
-5
lines changed
packages/vscode-vue-languageservice/src/parsers 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,15 @@ export function parse(docText: string, ss: css.Stylesheet) {
16
16
function visChild ( node : StylesheetNode ) {
17
17
if ( node . type === 22 ) {
18
18
const nodeText = docText . substring ( node . offset , node . end ) ;
19
- const reg = / ^ v - b i n d \s * \( \s * ( \S * ) \s * \) $ / ;
20
- const match = nodeText . match ( reg ) ;
21
- if ( match ) {
19
+ const reg = / v - b i n d \s * \( \s * ( [ ^ \s \) ] * ) \s * \) / g ;
20
+ const matchs = nodeText . matchAll ( reg ) ;
21
+ for ( const match of matchs ) {
22
22
const matchText = match [ 1 ] ;
23
- const offset = node . offset + nodeText . lastIndexOf ( matchText ) ;
24
- result . push ( { start : offset , end : offset + matchText . length } ) ;
23
+ const matchIndex = match . index ! ;
24
+ if ( match . index !== undefined ) {
25
+ const offset = node . offset + matchIndex + nodeText . substr ( matchIndex ) . indexOf ( matchText ) ;
26
+ result . push ( { start : offset , end : offset + matchText . length } ) ;
27
+ }
25
28
}
26
29
}
27
30
else if ( node . children ) {
You can’t perform that action at this time.
0 commit comments