mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Component commits:
e61702c7df Fix extract type crash
Co-authored-by: Andrew Branch <andrew@wheream.io>
This commit is contained in:
co-authored by
Andrew Branch
parent
a5ebd5382b
commit
0854a93040
@@ -145,8 +145,8 @@ namespace ts.refactor {
|
||||
if (isTypeReferenceNode(node)) {
|
||||
if (isIdentifier(node.typeName)) {
|
||||
const symbol = checker.resolveName(node.typeName.text, node.typeName, SymbolFlags.TypeParameter, /* excludeGlobals */ true);
|
||||
if (symbol?.declarations) {
|
||||
const declaration = cast(first(symbol.declarations), isTypeParameterDeclaration);
|
||||
const declaration = tryCast(symbol?.declarations?.[0], isTypeParameterDeclaration);
|
||||
if (declaration) {
|
||||
if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) {
|
||||
pushIfUnique(result, declaration);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user