File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -499,15 +499,7 @@ class TailwindIntellisense {
499
499
items : this . _items ,
500
500
languages : [ 'vue' ] ,
501
501
regex : / \b c l a s s = [ " ' ] ( [ ^ " ' ] * ) $ / ,
502
- enable : text => {
503
- if (
504
- text . indexOf ( '<template' ) !== - 1 &&
505
- text . indexOf ( '</template>' ) === - 1
506
- ) {
507
- return true
508
- }
509
- return false
510
- } ,
502
+ enable : isWithinTemplate ,
511
503
triggerCharacters : [ "'" , '"' , ' ' , separator ]
512
504
. concat ( [
513
505
Object . keys (
@@ -788,3 +780,13 @@ function createScreenCompletionItemProvider({
788
780
' '
789
781
)
790
782
}
783
+
784
+ function isWithinTemplate ( text : string ) {
785
+ let regex = / ( < \/ ? t e m p l a t e \b ) / g
786
+ let match
787
+ let d = 0
788
+ while ( ( match = regex . exec ( text ) ) !== null ) {
789
+ d += match [ 0 ] === '</template' ? - 1 : 1
790
+ }
791
+ return d !== 0
792
+ }
You can’t perform that action at this time.
0 commit comments