@@ -14,7 +14,7 @@ export class HTMLPlugin implements OnRegister, HoverProvider, CompletionsProvide
14
14
15
15
onRegister ( docManager : DocumentManager , configManager : LSConfigManager ) {
16
16
this . configManager = configManager ;
17
- docManager . on ( 'documentChange' , document => {
17
+ docManager . on ( 'documentChange' , ( document ) => {
18
18
const html = this . lang . parseHTMLDocument ( document ) ;
19
19
this . documents . set ( document , html ) ;
20
20
} ) ;
@@ -43,6 +43,10 @@ export class HTMLPlugin implements OnRegister, HoverProvider, CompletionsProvide
43
43
return null ;
44
44
}
45
45
46
+ if ( this . isInsideMoustacheTag ( html , document , position ) ) {
47
+ return null ;
48
+ }
49
+
46
50
const emmetResults : CompletionList = {
47
51
isIncomplete : true ,
48
52
items : [ ] ,
@@ -64,9 +68,20 @@ export class HTMLPlugin implements OnRegister, HoverProvider, CompletionsProvide
64
68
return null ;
65
69
}
66
70
71
+ if ( this . isInsideMoustacheTag ( html , document , position ) ) {
72
+ return null ;
73
+ }
74
+
67
75
return this . lang . doTagComplete ( document , position , html ) ;
68
76
}
69
77
78
+ private isInsideMoustacheTag ( html : HTMLDocument , document : Document , position : Position ) {
79
+ const offset = document . offsetAt ( position ) ;
80
+ const node = html . findNodeAt ( offset ) ;
81
+ const charactersInNode = document . getText ( ) . substring ( node . start , offset ) ;
82
+ return charactersInNode . lastIndexOf ( '{' ) > charactersInNode . lastIndexOf ( '}' ) ;
83
+ }
84
+
70
85
getDocumentSymbols ( document : Document ) : SymbolInformation [ ] {
71
86
if ( ! this . featureEnabled ( 'documentSymbols' ) ) {
72
87
return [ ] ;
0 commit comments