File tree 3 files changed +25
-7
lines changed
packages/language-service/lib/plugins
test-workspace/language-service/complete/#4639
3 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -159,11 +159,15 @@ export function create(
159
159
return ;
160
160
}
161
161
162
- if ( sourceScript ?. generated ?. root instanceof VueVirtualCode ) {
163
- await afterHtmlCompletion (
164
- htmlComplete ,
165
- context . documents . get ( sourceScript . id , sourceScript . languageId , sourceScript . snapshot )
166
- ) ;
162
+ if ( sourceScript ?. generated ) {
163
+ const virtualCode = sourceScript . generated . embeddedCodes . get ( 'template' ) ;
164
+ if ( virtualCode ) {
165
+ const embeddedDocumentUri = context . encodeEmbeddedDocumentUri ( sourceScript . id , virtualCode . id ) ;
166
+ afterHtmlCompletion (
167
+ htmlComplete ,
168
+ context . documents . get ( embeddedDocumentUri , virtualCode . languageId , virtualCode . snapshot )
169
+ ) ;
170
+ }
167
171
}
168
172
169
173
return htmlComplete ;
@@ -660,9 +664,9 @@ export function create(
660
664
} ;
661
665
}
662
666
663
- function afterHtmlCompletion ( completionList : vscode . CompletionList , sourceDocument : TextDocument ) {
667
+ function afterHtmlCompletion ( completionList : vscode . CompletionList , document : TextDocument ) {
664
668
665
- const replacement = getReplacement ( completionList , sourceDocument ) ;
669
+ const replacement = getReplacement ( completionList , document ) ;
666
670
667
671
if ( replacement ) {
668
672
Original file line number Diff line number Diff line change
1
+ <script lang="ts" setup>
2
+ </script >
3
+
4
+ <template >
5
+ <div @click. />
6
+ <!-- ^complete: capture -->
7
+ </template >
Original file line number Diff line number Diff line change
1
+ <script lang="ts" setup>
2
+ </script >
3
+
4
+ <template >
5
+ <div @click.capture />
6
+ <!-- ^complete: capture -->
7
+ </template >
You can’t perform that action at this time.
0 commit comments