Skip to content

Commit 333b8ff

Browse files
author
Andy
authored
Fix typo: || should be parenthesized (microsoft#23811)
1 parent a1f9a4f commit 333b8ff

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/services/codefixes/importFixes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ namespace ts.codefix {
114114
}
115115

116116
for (const exported of checker.getExportsOfModule(moduleSymbol)) {
117-
if (exported.escapedName === InternalSymbolName.Default || exported.name === symbolName && skipAlias(exported, checker) === exportedSymbol) {
117+
if ((exported.escapedName === InternalSymbolName.Default || exported.name === symbolName) && skipAlias(exported, checker) === exportedSymbol) {
118118
const isDefaultExport = checker.tryGetMemberInModuleExports(InternalSymbolName.Default, moduleSymbol) === exported;
119119
result.push({ moduleSymbol, importKind: isDefaultExport ? ImportKind.Default : ImportKind.Named });
120120
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: /node_modules/foo/index.ts
4+
////export default function f(): void;
5+
6+
// @Filename: /node_modules/bar/concat.d.ts
7+
////export const concat = 0;
8+
9+
// @Filename: /a.ts
10+
////export {};
11+
////conca/**/
12+
13+
goTo.file("/a.ts");
14+
15+
verify.completions({
16+
at: "",
17+
includes: [
18+
{ name: "concat", source: "/node_modules/bar/concat", sourceDisplay: "bar/concat", text: "const concat: 0", kind: "const", hasAction: true },
19+
],
20+
preferences: { includeCompletionsForModuleExports: true },
21+
});
22+
23+
verify.applyCodeActionFromCompletion("", {
24+
name: "concat",
25+
source: "/node_modules/bar/concat",
26+
description: `Import 'concat' from module "bar/concat"`,
27+
newFileContent:
28+
`import { concat } from "bar/concat";
29+
30+
export {};
31+
conca`,
32+
});

0 commit comments

Comments
 (0)