diff --git a/tsserver/protocol.d.ts b/tsserver/protocol.d.ts index 66ad7eb2..68651b80 100644 --- a/tsserver/protocol.d.ts +++ b/tsserver/protocol.d.ts @@ -2265,7 +2265,7 @@ declare namespace ts.server.protocol { } interface UserPreferences { readonly disableSuggestions?: boolean; - readonly quotePreference?: "double" | "single"; + readonly quotePreference?: "auto" | "double" | "single"; /** * If enabled, TypeScript will search through all external modules' exports and add them to the completions list. * This affects lone identifier completions but not completions on the right hand side of `obj.`. diff --git a/tsserver/tsc.js b/tsserver/tsc.js index 2de7a3e7..558b1764 100644 --- a/tsserver/tsc.js +++ b/tsserver/tsc.js @@ -61,7 +61,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook var ts; (function (ts) { ts.versionMajorMinor = "3.3"; - ts.version = ts.versionMajorMinor + ".1"; + ts.version = ts.versionMajorMinor + ".3333"; })(ts || (ts = {})); (function (ts) { ts.emptyArray = []; @@ -22903,15 +22903,19 @@ var ts; flowAfterCatch = currentFlow; } if (node.finallyBlock) { + var preFinallyPrior = preTryFlow; if (!node.catchClause) { if (tryPriors.length) { + var preFinallyFlow_1 = createBranchLabel(); + addAntecedent(preFinallyFlow_1, preTryFlow); for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) { var p = tryPriors_2[_a]; - addAntecedent(preFinallyLabel, p); + addAntecedent(preFinallyFlow_1, p); } + preFinallyPrior = finishFlowLabel(preFinallyFlow_1); } } - var preFinallyFlow = { flags: 2048, antecedent: preTryFlow, lock: {} }; + var preFinallyFlow = { flags: 2048, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); @@ -48476,7 +48480,7 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - fileToDirective.set(file.path, key); + addReferencedFilesToTypeDirective(file, key); }); } return { @@ -48615,6 +48619,19 @@ var ts; } return false; } + function addReferencedFilesToTypeDirective(file, key) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, key); + for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) { + var fileName = _a[_i].fileName; + var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration) { var specifier = declaration.kind === 244 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); diff --git a/tsserver/tsserver.js b/tsserver/tsserver.js index 93b04dac..990d0f29 100644 --- a/tsserver/tsserver.js +++ b/tsserver/tsserver.js @@ -88,7 +88,7 @@ var ts; // If changing the text in this section, be sure to test `configureNightly` too. ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".1"; + ts.version = ts.versionMajorMinor + ".3333"; })(ts || (ts = {})); (function (ts) { /* @internal */ @@ -28107,12 +28107,16 @@ var ts; // We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block // (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will // have the end of the `try` block and the end of the `catch` block) + var preFinallyPrior = preTryFlow; if (!node.catchClause) { if (tryPriors.length) { + var preFinallyFlow_1 = createBranchLabel(); + addAntecedent(preFinallyFlow_1, preTryFlow); for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) { var p = tryPriors_2[_a]; - addAntecedent(preFinallyLabel, p); + addAntecedent(preFinallyFlow_1, p); } + preFinallyPrior = finishFlowLabel(preFinallyFlow_1); } } // in finally flow is combined from pre-try/flow from try/flow from catch @@ -28141,7 +28145,7 @@ var ts; // // extra edges that we inject allows to control this behavior // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. - var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); @@ -57874,7 +57878,9 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - fileToDirective.set(file.path, key); + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); }); } return { @@ -58029,6 +58035,19 @@ var ts; } return false; } + function addReferencedFilesToTypeDirective(file, key) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, key); + for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) { + var fileName = _a[_i].fileName; + var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration) { var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); @@ -94462,7 +94481,7 @@ var ts; } ts.quotePreferenceFromString = quotePreferenceFromString; function getQuotePreference(sourceFile, preferences) { - if (preferences.quotePreference) { + if (preferences.quotePreference && preferences.quotePreference !== "auto") { return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { @@ -95033,15 +95052,18 @@ var ts; if (/^\d+$/.test(text)) { return text; } + // Editors can pass in undefined or empty string - we want to infer the preference in those cases. + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - switch (preferences.quotePreference) { - case undefined: + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": case "double": return quoted; case "single": return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; default: - return ts.Debug.assertNever(preferences.quotePreference); + return ts.Debug.assertNever(quotePreference); } } ts.quote = quote; @@ -113925,7 +113947,9 @@ var ts; } function createStubbedMethodBody(preferences) { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), - /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], + /*typeArguments*/ undefined, + // TODO Handle auto quote preference. + [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], /*multiline*/ true); } function createVisibilityModifier(flags) { diff --git a/tsserver/tsserverlibrary.d.ts b/tsserver/tsserverlibrary.d.ts index ae457551..a09413fb 100644 --- a/tsserver/tsserverlibrary.d.ts +++ b/tsserver/tsserverlibrary.d.ts @@ -3009,7 +3009,7 @@ declare namespace ts { } interface UserPreferences { readonly disableSuggestions?: boolean; - readonly quotePreference?: "double" | "single"; + readonly quotePreference?: "auto" | "double" | "single"; readonly includeCompletionsForModuleExports?: boolean; readonly includeCompletionsWithInsertText?: boolean; readonly importModuleSpecifierPreference?: "relative" | "non-relative"; @@ -7925,7 +7925,7 @@ declare namespace ts.server.protocol { } interface UserPreferences { readonly disableSuggestions?: boolean; - readonly quotePreference?: "double" | "single"; + readonly quotePreference?: "auto" | "double" | "single"; /** * If enabled, TypeScript will search through all external modules' exports and add them to the completions list. * This affects lone identifier completions but not completions on the right hand side of `obj.`. diff --git a/tsserver/tsserverlibrary.js b/tsserver/tsserverlibrary.js index f2ff48d0..f3a488d1 100644 --- a/tsserver/tsserverlibrary.js +++ b/tsserver/tsserverlibrary.js @@ -84,7 +84,7 @@ var ts; // If changing the text in this section, be sure to test `configureNightly` too. ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".1"; + ts.version = ts.versionMajorMinor + ".3333"; })(ts || (ts = {})); (function (ts) { /* @internal */ @@ -28103,12 +28103,16 @@ var ts; // We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block // (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will // have the end of the `try` block and the end of the `catch` block) + var preFinallyPrior = preTryFlow; if (!node.catchClause) { if (tryPriors.length) { + var preFinallyFlow_1 = createBranchLabel(); + addAntecedent(preFinallyFlow_1, preTryFlow); for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) { var p = tryPriors_2[_a]; - addAntecedent(preFinallyLabel, p); + addAntecedent(preFinallyFlow_1, p); } + preFinallyPrior = finishFlowLabel(preFinallyFlow_1); } } // in finally flow is combined from pre-try/flow from try/flow from catch @@ -28137,7 +28141,7 @@ var ts; // // extra edges that we inject allows to control this behavior // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. - var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); @@ -57870,7 +57874,9 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - fileToDirective.set(file.path, key); + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); }); } return { @@ -58025,6 +58031,19 @@ var ts; } return false; } + function addReferencedFilesToTypeDirective(file, key) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, key); + for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) { + var fileName = _a[_i].fileName; + var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration) { var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); @@ -94772,7 +94791,7 @@ var ts; } ts.quotePreferenceFromString = quotePreferenceFromString; function getQuotePreference(sourceFile, preferences) { - if (preferences.quotePreference) { + if (preferences.quotePreference && preferences.quotePreference !== "auto") { return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { @@ -95343,15 +95362,18 @@ var ts; if (/^\d+$/.test(text)) { return text; } + // Editors can pass in undefined or empty string - we want to infer the preference in those cases. + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - switch (preferences.quotePreference) { - case undefined: + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": case "double": return quoted; case "single": return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; default: - return ts.Debug.assertNever(preferences.quotePreference); + return ts.Debug.assertNever(quotePreference); } } ts.quote = quote; @@ -114235,7 +114257,9 @@ var ts; } function createStubbedMethodBody(preferences) { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), - /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], + /*typeArguments*/ undefined, + // TODO Handle auto quote preference. + [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], /*multiline*/ true); } function createVisibilityModifier(flags) { diff --git a/tsserver/typescript.d.ts b/tsserver/typescript.d.ts index a7dd2892..83e72bf2 100644 --- a/tsserver/typescript.d.ts +++ b/tsserver/typescript.d.ts @@ -3009,7 +3009,7 @@ declare namespace ts { } interface UserPreferences { readonly disableSuggestions?: boolean; - readonly quotePreference?: "double" | "single"; + readonly quotePreference?: "auto" | "double" | "single"; readonly includeCompletionsForModuleExports?: boolean; readonly includeCompletionsWithInsertText?: boolean; readonly importModuleSpecifierPreference?: "relative" | "non-relative"; diff --git a/tsserver/typescript.js b/tsserver/typescript.js index 149e147c..d2e2e7ec 100644 --- a/tsserver/typescript.js +++ b/tsserver/typescript.js @@ -75,7 +75,7 @@ var ts; // If changing the text in this section, be sure to test `configureNightly` too. ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".1"; + ts.version = ts.versionMajorMinor + ".3333"; })(ts || (ts = {})); (function (ts) { /* @internal */ @@ -28094,12 +28094,16 @@ var ts; // We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block // (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will // have the end of the `try` block and the end of the `catch` block) + var preFinallyPrior = preTryFlow; if (!node.catchClause) { if (tryPriors.length) { + var preFinallyFlow_1 = createBranchLabel(); + addAntecedent(preFinallyFlow_1, preTryFlow); for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) { var p = tryPriors_2[_a]; - addAntecedent(preFinallyLabel, p); + addAntecedent(preFinallyFlow_1, p); } + preFinallyPrior = finishFlowLabel(preFinallyFlow_1); } } // in finally flow is combined from pre-try/flow from try/flow from catch @@ -28128,7 +28132,7 @@ var ts; // // extra edges that we inject allows to control this behavior // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. - var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); @@ -57861,7 +57865,9 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - fileToDirective.set(file.path, key); + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); }); } return { @@ -58016,6 +58022,19 @@ var ts; } return false; } + function addReferencedFilesToTypeDirective(file, key) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, key); + for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) { + var fileName = _a[_i].fileName; + var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration) { var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); @@ -94763,7 +94782,7 @@ var ts; } ts.quotePreferenceFromString = quotePreferenceFromString; function getQuotePreference(sourceFile, preferences) { - if (preferences.quotePreference) { + if (preferences.quotePreference && preferences.quotePreference !== "auto") { return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { @@ -95334,15 +95353,18 @@ var ts; if (/^\d+$/.test(text)) { return text; } + // Editors can pass in undefined or empty string - we want to infer the preference in those cases. + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - switch (preferences.quotePreference) { - case undefined: + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": case "double": return quoted; case "single": return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; default: - return ts.Debug.assertNever(preferences.quotePreference); + return ts.Debug.assertNever(quotePreference); } } ts.quote = quote; @@ -114226,7 +114248,9 @@ var ts; } function createStubbedMethodBody(preferences) { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), - /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], + /*typeArguments*/ undefined, + // TODO Handle auto quote preference. + [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], /*multiline*/ true); } function createVisibilityModifier(flags) { diff --git a/tsserver/typescriptServices.d.ts b/tsserver/typescriptServices.d.ts index 6cf4178c..546acda5 100644 --- a/tsserver/typescriptServices.d.ts +++ b/tsserver/typescriptServices.d.ts @@ -3009,7 +3009,7 @@ declare namespace ts { } interface UserPreferences { readonly disableSuggestions?: boolean; - readonly quotePreference?: "double" | "single"; + readonly quotePreference?: "auto" | "double" | "single"; readonly includeCompletionsForModuleExports?: boolean; readonly includeCompletionsWithInsertText?: boolean; readonly importModuleSpecifierPreference?: "relative" | "non-relative"; diff --git a/tsserver/typescriptServices.js b/tsserver/typescriptServices.js index 149e147c..d2e2e7ec 100644 --- a/tsserver/typescriptServices.js +++ b/tsserver/typescriptServices.js @@ -75,7 +75,7 @@ var ts; // If changing the text in this section, be sure to test `configureNightly` too. ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".1"; + ts.version = ts.versionMajorMinor + ".3333"; })(ts || (ts = {})); (function (ts) { /* @internal */ @@ -28094,12 +28094,16 @@ var ts; // We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block // (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will // have the end of the `try` block and the end of the `catch` block) + var preFinallyPrior = preTryFlow; if (!node.catchClause) { if (tryPriors.length) { + var preFinallyFlow_1 = createBranchLabel(); + addAntecedent(preFinallyFlow_1, preTryFlow); for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) { var p = tryPriors_2[_a]; - addAntecedent(preFinallyLabel, p); + addAntecedent(preFinallyFlow_1, p); } + preFinallyPrior = finishFlowLabel(preFinallyFlow_1); } } // in finally flow is combined from pre-try/flow from try/flow from catch @@ -28128,7 +28132,7 @@ var ts; // // extra edges that we inject allows to control this behavior // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. - var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); @@ -57861,7 +57865,9 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - fileToDirective.set(file.path, key); + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); }); } return { @@ -58016,6 +58022,19 @@ var ts; } return false; } + function addReferencedFilesToTypeDirective(file, key) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, key); + for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) { + var fileName = _a[_i].fileName; + var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration) { var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); @@ -94763,7 +94782,7 @@ var ts; } ts.quotePreferenceFromString = quotePreferenceFromString; function getQuotePreference(sourceFile, preferences) { - if (preferences.quotePreference) { + if (preferences.quotePreference && preferences.quotePreference !== "auto") { return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { @@ -95334,15 +95353,18 @@ var ts; if (/^\d+$/.test(text)) { return text; } + // Editors can pass in undefined or empty string - we want to infer the preference in those cases. + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - switch (preferences.quotePreference) { - case undefined: + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": case "double": return quoted; case "single": return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; default: - return ts.Debug.assertNever(preferences.quotePreference); + return ts.Debug.assertNever(quotePreference); } } ts.quote = quote; @@ -114226,7 +114248,9 @@ var ts; } function createStubbedMethodBody(preferences) { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), - /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], + /*typeArguments*/ undefined, + // TODO Handle auto quote preference. + [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], /*multiline*/ true); } function createVisibilityModifier(flags) { diff --git a/tsserver/typingsInstaller.js b/tsserver/typingsInstaller.js index c4a44409..a01adc7f 100644 --- a/tsserver/typingsInstaller.js +++ b/tsserver/typingsInstaller.js @@ -88,7 +88,7 @@ var ts; // If changing the text in this section, be sure to test `configureNightly` too. ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".1"; + ts.version = ts.versionMajorMinor + ".3333"; })(ts || (ts = {})); (function (ts) { /* @internal */ @@ -28107,12 +28107,16 @@ var ts; // We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block // (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will // have the end of the `try` block and the end of the `catch` block) + var preFinallyPrior = preTryFlow; if (!node.catchClause) { if (tryPriors.length) { + var preFinallyFlow_1 = createBranchLabel(); + addAntecedent(preFinallyFlow_1, preTryFlow); for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) { var p = tryPriors_2[_a]; - addAntecedent(preFinallyLabel, p); + addAntecedent(preFinallyFlow_1, p); } + preFinallyPrior = finishFlowLabel(preFinallyFlow_1); } } // in finally flow is combined from pre-try/flow from try/flow from catch @@ -28141,7 +28145,7 @@ var ts; // // extra edges that we inject allows to control this behavior // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. - var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); @@ -57874,7 +57878,9 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - fileToDirective.set(file.path, key); + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); }); } return { @@ -58029,6 +58035,19 @@ var ts; } return false; } + function addReferencedFilesToTypeDirective(file, key) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, key); + for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) { + var fileName = _a[_i].fileName; + var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration) { var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);