mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-12 23:36:28 -05:00
Fix JSDoc @import crashes in getCompletionEntryDetails
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user