-
-
Notifications
You must be signed in to change notification settings - Fork 466
Closed as not planned
Closed as not planned
Bug
Copy link
Labels
good reproduction ✨This issue provides a good reproduction, we will be able to investigate it firstThis issue provides a good reproduction, we will be able to investigate it firstupstream: typescript
Description
Vue - Official extension or vue-tsc version
3.0.0-alpha.0
VSCode version
1.98.0
Vue version
3.5.13
TypeScript version
5.8.2
System Info
package.json dependencies
{
"dependencies": {
"vue": "^3.5.13"
}
}
Steps to reproduce
- Create a new
.vue
file - Copy and paste or write it:
<template>
<div></div>
</template>
<script setup>
/** @import { PropType } from 'vue' */
const test = ref(null);
</script>
- Put the cursor after
ref
word and pressCTRL+SPACE
for suggestions. Thevue
suggestion should be shown but will not be applied if you try to apply it. No effect.
- If you remove the JSDoc import line, and try the step 3 again, it works fine.
What is expected?
The import
line should be added correctly as it does when JSDoc import tag is not being used.
What is actually happening?
The import
line is not being added when JSDoc tag import tag is being used.
TS Server Log:
Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isTypeKeywordToken'.
Error: Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isTypeKeywordToken'.
at cast (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:3350:16)
at getTypeKeywordOfTypeOnlyImport (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:139958:10)
at doAddExistingFix (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:158730:32)
at codeActionForFixWorker (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:158516:7)
at c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:158501:13
at _ChangeTracker.with (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:178070:5)
at codeActionForFix (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:158500:60)
at Object.getImportCompletionAction (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:157888:43)
at getCompletionEntryCodeActionsAndSourceDisplay (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:167777:62)
at Object.getCompletionEntryDetails (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:167642:46)
at getCompletionEntryDetails2 (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:152207:35)
at c:\Users\twist\.vscode\extensions\vue.volar-3.0.0-alpha.0\node_modules\vue-typescript-plugin-pack\index.js:5:8230
at Proxy.<anonymous> (c:\Users\twist\.vscode\extensions\vue.volar-3.0.0-alpha.0\node_modules\vue-typescript-plugin-pack\index.js:8:13714)
at c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:194945:43
at mapDefined (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:2606:22)
at IpcIOSession.getCompletionEntryDetails (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:194943:20)
at completionEntryDetails (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:193184:43)
at c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:195676:15
at IpcIOSession.executeWithRequestId (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:195665:14)
at IpcIOSession.executeCommand (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:195674:29)
at IpcIOSession.onMessage (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:195722:68)
at process.<anonymous> (c:\Users\twist\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\_tsserver.js:519:14)
at process.emit (node:events:518:28)
at emit (node:internal/child_process:950:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Link to minimal reproduction
No response
Any additional comments?
The same behaviour for 2.2.8 version.
You can try to do the same in the Vue SFC Playground. The only difference is that there will be no suggestion to import from vue
package.
Metadata
Metadata
Assignees
Labels
good reproduction ✨This issue provides a good reproduction, we will be able to investigate it firstThis issue provides a good reproduction, we will be able to investigate it firstupstream: typescript