mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
In getSymbolAtLocation, return undefined instead of unknownSymbol (#21774)
* In getSymbolAtLocation, return undefined instead of unknownSymbol * Update check in completions to look for undefined instead of unknownSymbol
This commit is contained in:
@@ -24628,7 +24628,8 @@ namespace ts {
|
||||
|
||||
if (entityName.kind === SyntaxKind.Identifier) {
|
||||
if (isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) {
|
||||
return getIntrinsicTagSymbol(<JsxOpeningLikeElement>entityName.parent);
|
||||
const symbol = getIntrinsicTagSymbol(<JsxOpeningLikeElement>entityName.parent);
|
||||
return symbol === unknownSymbol ? undefined : symbol;
|
||||
}
|
||||
|
||||
return resolveEntityName(entityName, SymbolFlags.Value, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
|
||||
|
||||
@@ -923,9 +923,8 @@ namespace ts.Completions {
|
||||
}
|
||||
else if (isStartingCloseTag) {
|
||||
const tagName = (<JsxElement>contextToken.parent.parent).openingElement.tagName;
|
||||
const tagSymbol = Debug.assertDefined(typeChecker.getSymbolAtLocation(tagName));
|
||||
|
||||
if (!typeChecker.isUnknownSymbol(tagSymbol)) {
|
||||
const tagSymbol = typeChecker.getSymbolAtLocation(tagName);
|
||||
if (tagSymbol) {
|
||||
symbols = [tagSymbol];
|
||||
}
|
||||
completionKind = CompletionKind.MemberLike;
|
||||
|
||||
Reference in New Issue
Block a user