Fix JSDoc @import crashes in getCompletionEntryDetails

Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-07-09 16:27:57 +00:00
parent 5fc84dfaa3
commit 999fdc858a

View File

@ -1834,7 +1834,10 @@ function promoteFromTypeOnly(
}
function promoteImportClause(importClause: ImportClause) {
changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(importClause, sourceFile));
// JSDoc imports are inherently type-only and don't have a removable 'type' keyword
if (!isJSDocImportTag(importClause.parent)) {
changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(importClause, sourceFile));
}
// Change .ts extension to .js if necessary
if (!compilerOptions.allowImportingTsExtensions) {
const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(importClause.parent);