@@ -88,13 +88,18 @@ export class AngularLanguageClient implements vscode.Disposable {
88
88
89
89
const angularResultsPromise = next ( document , position , token ) ;
90
90
91
- const vdocUri = this . createVirtualHtmlDoc ( document ) ;
92
- const htmlProviderResultsPromise = vscode . commands . executeCommand < vscode . Hover [ ] > (
93
- 'vscode.executeHoverProvider' , vdocUri , position ) ;
91
+ // Include results for inline HTML via virtual document and native html providers.
92
+ if ( document . languageId === 'typescript' ) {
93
+ const vdocUri = this . createVirtualHtmlDoc ( document ) ;
94
+ const htmlProviderResultsPromise = vscode . commands . executeCommand < vscode . Hover [ ] > (
95
+ 'vscode.executeHoverProvider' , vdocUri , position ) ;
96
+
97
+ const [ angularResults , htmlProviderResults ] =
98
+ await Promise . all ( [ angularResultsPromise , htmlProviderResultsPromise ] ) ;
99
+ return angularResults ?? htmlProviderResults ?. [ 0 ] ;
100
+ }
94
101
95
- const [ angularResults , htmlProviderResults ] =
96
- await Promise . all ( [ angularResultsPromise , htmlProviderResultsPromise ] ) ;
97
- return angularResults ?? htmlProviderResults ?. [ 0 ] ;
102
+ return angularResultsPromise ;
98
103
} ,
99
104
provideSignatureHelp : async (
100
105
document : vscode . TextDocument , position : vscode . Position ,
@@ -117,17 +122,21 @@ export class AngularLanguageClient implements vscode.Disposable {
117
122
const angularCompletionsPromise = next ( document , position , context , token ) as
118
123
Promise < vscode . CompletionItem [ ] | null | undefined > ;
119
124
120
- const vdocUri = this . createVirtualHtmlDoc ( document ) ;
121
- // This will not include angular stuff because the vdoc is not associated with an angular
122
- // component
123
- const htmlProviderCompletionsPromise =
124
- vscode . commands . executeCommand < vscode . CompletionList > (
125
- 'vscode.executeCompletionItemProvider' , vdocUri , position ,
126
- context . triggerCharacter ) ;
127
- const [ angularCompletions , htmlProviderCompletions ] =
128
- await Promise . all ( [ angularCompletionsPromise , htmlProviderCompletionsPromise ] ) ;
129
-
130
- return [ ...( angularCompletions ?? [ ] ) , ...( htmlProviderCompletions ?. items ?? [ ] ) ] ;
125
+ // Include results for inline HTML via virtual document and native html providers.
126
+ if ( document . languageId === 'typescript' ) {
127
+ const vdocUri = this . createVirtualHtmlDoc ( document ) ;
128
+ // This will not include angular stuff because the vdoc is not associated with an
129
+ // angular component
130
+ const htmlProviderCompletionsPromise =
131
+ vscode . commands . executeCommand < vscode . CompletionList > (
132
+ 'vscode.executeCompletionItemProvider' , vdocUri , position ,
133
+ context . triggerCharacter ) ;
134
+ const [ angularCompletions , htmlProviderCompletions ] =
135
+ await Promise . all ( [ angularCompletionsPromise , htmlProviderCompletionsPromise ] ) ;
136
+ return [ ...( angularCompletions ?? [ ] ) , ...( htmlProviderCompletions ?. items ?? [ ] ) ] ;
137
+ }
138
+
139
+ return angularCompletionsPromise ;
131
140
}
132
141
}
133
142
} ;
0 commit comments