mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:41:22 -06:00
Fix JSDoc @import crashes in getCompletionEntryDetails
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
This commit is contained in:
parent
5fc84dfaa3
commit
999fdc858a
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user