Add fourslash tests

This commit is contained in:
Andrew Casey
2019-01-16 19:18:25 -08:00
parent 7102de77d3
commit 3e256e14dc
4 changed files with 69 additions and 0 deletions

View File

@@ -510,7 +510,12 @@ namespace ts.refactor {
}
const jsxNamespace = checker.getJsxNamespace(containsJsx);
// Strictly speaking, this could resolve to a symbol other than the JSX namespace.
// This will produce erroneous output (probably, an incorrectly copied import) but
// is expected to be very rare and easily reversible.
const jsxNamespaceSymbol = checker.resolveName(jsxNamespace, containsJsx, SymbolFlags.Namespace, /*excludeGlobals*/ true);
return !!jsxNamespaceSymbol && some(jsxNamespaceSymbol.declarations, isInImport)
? jsxNamespaceSymbol
: undefined;