Fix typo: || should be parenthesized (#23811)

This commit is contained in:
Andy 2018-05-01 14:59:58 -07:00 committed by GitHub
parent a1f9a4fb24
commit 333b8ff028
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 1 deletions

View file

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

View file

@ -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`,
});