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:
Andy
2018-02-08 14:35:21 -08:00
committed by GitHub
parent 16f3b93ffd
commit e2178ecfab
60 changed files with 37 additions and 372 deletions

View File

@@ -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);

View File

@@ -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;