Skip to content

Commit 938a69a

Browse files
authoredSep 20, 2022
Fix import statement completions followed by interface declaration (#50350)
* Fix import statement completions followed by interface declaration * Fix stuff * Linty * Fix when named imports is missing closing brace
1 parent e002159 commit 938a69a

File tree

5 files changed

+180
-77
lines changed

5 files changed

+180
-77
lines changed
 

‎src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41414,7 +41414,7 @@ namespace ts {
4141441414
}
4141541415
else {
4141641416
Debug.assert(node.kind !== SyntaxKind.VariableDeclaration);
41417-
const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)) as ImportDeclaration | ImportEqualsDeclaration | undefined;
41417+
const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration));
4141841418
const moduleSpecifier = (importDeclaration && tryGetModuleSpecifierFromDeclaration(importDeclaration)?.text) ?? "...";
4141941419
const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName);
4142041420
error(

‎src/compiler/core.ts

+3
Original file line numberDiff line numberDiff line change
@@ -2371,6 +2371,9 @@ namespace ts {
23712371
return (arg: T) => f(arg) && g(arg);
23722372
}
23732373

2374+
export function or<P, R1 extends P, R2 extends P>(f1: (p1: P) => p1 is R1, f2: (p2: P) => p2 is R2): (p: P) => p is R1 | R2;
2375+
export function or<P, R1 extends P, R2 extends P, R3 extends P>(f1: (p1: P) => p1 is R1, f2: (p2: P) => p2 is R2, f3: (p3: P) => p3 is R3): (p: P) => p is R1 | R2 | R3;
2376+
export function or<T extends unknown[], U>(...fs: ((...args: T) => U)[]): (...args: T) => U;
23742377
export function or<T extends unknown[], U>(...fs: ((...args: T) => U)[]): (...args: T) => U {
23752378
return (...args) => {
23762379
let lastResult: U;

0 commit comments

Comments
 (0)
Please sign in to comment.