mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Remove unnecessary filtering of tsx completions (#24004)
This commit is contained in:
@@ -899,7 +899,7 @@ namespace FourSlash {
|
||||
}
|
||||
else {
|
||||
const found = actualByName.get(exclude.name);
|
||||
if (found.source === exclude.source) {
|
||||
if (found && found.source === exclude.source) {
|
||||
this.raiseError(`Did not expect to get a completion named ${exclude.name} with source ${exclude.source}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -972,12 +972,8 @@ namespace ts.Completions {
|
||||
}
|
||||
else if (isRightOfOpenTag) {
|
||||
const tagSymbols = Debug.assertEachDefined(typeChecker.getJsxIntrinsicTagNamesAt(location), "getJsxIntrinsicTagNames() should all be defined");
|
||||
if (tryGetGlobalSymbols()) {
|
||||
symbols = tagSymbols.concat(symbols.filter(s => !!(s.flags & (SymbolFlags.Value | SymbolFlags.Alias))));
|
||||
}
|
||||
else {
|
||||
symbols = tagSymbols;
|
||||
}
|
||||
tryGetGlobalSymbols();
|
||||
symbols = tagSymbols.concat(symbols);
|
||||
completionKind = CompletionKind.MemberLike;
|
||||
}
|
||||
else if (isStartingCloseTag) {
|
||||
@@ -1298,7 +1294,7 @@ namespace ts.Completions {
|
||||
const exportedSymbols = typeChecker.getExportsOfModule(symbol);
|
||||
// If the exported symbols contains type,
|
||||
// symbol can be referenced at locations where type is allowed
|
||||
return forEach(exportedSymbols, symbolCanBeReferencedAtTypeLocation);
|
||||
return exportedSymbols.some(symbolCanBeReferencedAtTypeLocation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user