Fix typo: ||
should be parenthesized (#23811)
This commit is contained in:
parent
a1f9a4fb24
commit
333b8ff028
2 changed files with 33 additions and 1 deletions
|
@ -114,7 +114,7 @@ namespace ts.codefix {
|
|||
}
|
||||
|
||||
for (const exported of checker.getExportsOfModule(moduleSymbol)) {
|
||||
if (exported.escapedName === InternalSymbolName.Default || exported.name === symbolName && skipAlias(exported, checker) === exportedSymbol) {
|
||||
if ((exported.escapedName === InternalSymbolName.Default || exported.name === symbolName) && skipAlias(exported, checker) === exportedSymbol) {
|
||||
const isDefaultExport = checker.tryGetMemberInModuleExports(InternalSymbolName.Default, moduleSymbol) === exported;
|
||||
result.push({ moduleSymbol, importKind: isDefaultExport ? ImportKind.Default : ImportKind.Named });
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /node_modules/foo/index.ts
|
||||
////export default function f(): void;
|
||||
|
||||
// @Filename: /node_modules/bar/concat.d.ts
|
||||
////export const concat = 0;
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export {};
|
||||
////conca/**/
|
||||
|
||||
goTo.file("/a.ts");
|
||||
|
||||
verify.completions({
|
||||
at: "",
|
||||
includes: [
|
||||
{ name: "concat", source: "/node_modules/bar/concat", sourceDisplay: "bar/concat", text: "const concat: 0", kind: "const", hasAction: true },
|
||||
],
|
||||
preferences: { includeCompletionsForModuleExports: true },
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "concat",
|
||||
source: "/node_modules/bar/concat",
|
||||
description: `Import 'concat' from module "bar/concat"`,
|
||||
newFileContent:
|
||||
`import { concat } from "bar/concat";
|
||||
|
||||
export {};
|
||||
conca`,
|
||||
});
|
Loading…
Reference in a new issue