mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
In JSDoc, resolve import types as values too (#26066)
* In JSDoc, resolve import types as values too This is something that we probably should have been doing for some time. Fixes #26049 * Fix whitespace lint
This commit is contained in:
committed by
GitHub
parent
4bc7f1570b
commit
a21ac11582
@@ -8189,7 +8189,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function isJSDocTypeReference(node: Node): node is TypeReferenceNode {
|
||||
return !!(node.flags & NodeFlags.JSDoc) && node.kind === SyntaxKind.TypeReference;
|
||||
return !!(node.flags & NodeFlags.JSDoc) && (node.kind === SyntaxKind.TypeReference || node.kind === SyntaxKind.ImportType);
|
||||
}
|
||||
|
||||
function checkNoTypeArguments(node: NodeWithTypeArguments, symbol?: Symbol) {
|
||||
@@ -9462,7 +9462,7 @@ namespace ts {
|
||||
links.resolvedSymbol = unknownSymbol;
|
||||
return links.resolvedType = errorType;
|
||||
}
|
||||
const targetMeaning = node.isTypeOf ? SymbolFlags.Value : SymbolFlags.Type;
|
||||
const targetMeaning = node.isTypeOf ? SymbolFlags.Value : node.flags & NodeFlags.JSDoc ? SymbolFlags.Value | SymbolFlags.Type : SymbolFlags.Type;
|
||||
// TODO: Future work: support unions/generics/whatever via a deferred import-type
|
||||
const innerModuleSymbol = resolveExternalModuleName(node, node.argument.literal);
|
||||
if (!innerModuleSymbol) {
|
||||
|
||||
Reference in New Issue
Block a user