@@ -2278,7 +2278,7 @@ module.exports = __toCommonJS(typescript_exports);
22782278
22792279// src/compiler/corePublic.ts
22802280var versionMajorMinor = "5.7";
2281- var version = "5.7.1-rc ";
2281+ var version = "5.7.2 ";
22822282var Comparison = /* @__PURE__ */ ((Comparison3) => {
22832283 Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
22842284 Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -146430,23 +146430,22 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
146430146430 const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
146431146431 for (const statement of toMove) {
146432146432 forEachReference(statement, checker, enclosingRange, (symbol, isValidTypeOnlyUseSite) => {
146433- if (!symbol.declarations || isGlobalType(checker, symbol) ) {
146433+ if (!symbol.declarations) {
146434146434 return;
146435146435 }
146436146436 if (existingTargetLocals.has(skipAlias(symbol, checker))) {
146437146437 unusedImportsFromOldFile.add(symbol);
146438146438 return;
146439146439 }
146440- for (const decl of symbol.declarations) {
146441- if (isInImport(decl)) {
146442- const prevIsTypeOnly = oldImportsNeededByTargetFile.get(symbol);
146443- oldImportsNeededByTargetFile.set(symbol, [
146444- prevIsTypeOnly === void 0 ? isValidTypeOnlyUseSite : prevIsTypeOnly && isValidTypeOnlyUseSite,
146445- tryCast(decl, (d) => isImportSpecifier(d) || isImportClause(d) || isNamespaceImport(d) || isImportEqualsDeclaration(d) || isBindingElement(d) || isVariableDeclaration(d))
146446- ]);
146447- } else if (isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile && !movedSymbols.has(symbol)) {
146448- targetFileImportsFromOldFile.set(symbol, isValidTypeOnlyUseSite);
146449- }
146440+ const importedDeclaration = find(symbol.declarations, isInImport);
146441+ if (importedDeclaration) {
146442+ const prevIsTypeOnly = oldImportsNeededByTargetFile.get(symbol);
146443+ oldImportsNeededByTargetFile.set(symbol, [
146444+ prevIsTypeOnly === void 0 ? isValidTypeOnlyUseSite : prevIsTypeOnly && isValidTypeOnlyUseSite,
146445+ tryCast(importedDeclaration, (d) => isImportSpecifier(d) || isImportClause(d) || isNamespaceImport(d) || isImportEqualsDeclaration(d) || isBindingElement(d) || isVariableDeclaration(d))
146446+ ]);
146447+ } else if (!movedSymbols.has(symbol) && every(symbol.declarations, (decl) => isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile)) {
146448+ targetFileImportsFromOldFile.set(symbol, isValidTypeOnlyUseSite);
146450146449 }
146451146450 });
146452146451 }
@@ -146480,16 +146479,6 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
146480146479 return !!jsxNamespaceSymbol2 && some(jsxNamespaceSymbol2.declarations, isInImport) ? jsxNamespaceSymbol2 : void 0;
146481146480 }
146482146481}
146483- function isGlobalType(checker, symbol) {
146484- return !!checker.resolveName(
146485- symbol.name,
146486- /*location*/
146487- void 0,
146488- 788968 /* Type */,
146489- /*excludeGlobals*/
146490- false
146491- );
146492- }
146493146482function makeUniqueFilename(proposedFilename, extension, inDirectory, host) {
146494146483 let newFilename = proposedFilename;
146495146484 for (let i = 1; ; i++) {
@@ -151312,8 +151301,7 @@ var invalidOperationsInPartialSemanticMode = [
151312151301 "provideCallHierarchyOutgoingCalls",
151313151302 "provideInlayHints",
151314151303 "getSupportedCodeFixes",
151315- "getPasteEdits",
151316- "getImports"
151304+ "getPasteEdits"
151317151305];
151318151306var invalidOperationsInSyntacticMode = [
151319151307 ...invalidOperationsInPartialSemanticMode,
@@ -152565,18 +152553,6 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
152565152553 preferences
152566152554 );
152567152555 }
152568- function getImports(fileName) {
152569- var _a2, _b;
152570- synchronizeHostData();
152571- const file = getValidSourceFile(fileName);
152572- let imports;
152573- for (const specifier of file.imports) {
152574- if (nodeIsSynthesized(specifier)) continue;
152575- const name = (_b = (_a2 = program.getResolvedModuleFromModuleSpecifier(specifier, file)) == null ? void 0 : _a2.resolvedModule) == null ? void 0 : _b.resolvedFileName;
152576- if (name) (imports ?? (imports = /* @__PURE__ */ new Set())).add(name);
152577- }
152578- return imports ? arrayFrom(imports) : emptyArray;
152579- }
152580152556 const ls = {
152581152557 dispose,
152582152558 cleanupSemanticCache,
@@ -152650,8 +152626,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
152650152626 getSupportedCodeFixes,
152651152627 preparePasteEditsForFile,
152652152628 getPasteEdits,
152653- mapCode: mapCode2,
152654- getImports
152629+ mapCode: mapCode2
152655152630 };
152656152631 switch (languageServiceMode) {
152657152632 case 0 /* Semantic */:
@@ -193108,8 +193083,8 @@ var Session3 = class _Session {
193108193083 ["mapCode" /* MapCode */]: (request) => {
193109193084 return this.requiredResponse(this.mapCode(request.arguments));
193110193085 },
193111- ["copilotRelated" /* CopilotRelated */]: (request ) => {
193112- return this.requiredResponse(this.getCopilotRelatedInfo(request.arguments ));
193086+ ["copilotRelated" /* CopilotRelated */]: () => {
193087+ return this.requiredResponse(this.getCopilotRelatedInfo());
193113193088 }
193114193089 }));
193115193090 this.host = opts.host;
@@ -194057,10 +194032,9 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
194057194032 const changes = languageService.mapCode(file, args.mapping.contents, focusLocations, formatOptions, preferences);
194058194033 return this.mapTextChangesToCodeEdits(changes);
194059194034 }
194060- getCopilotRelatedInfo(args) {
194061- const { file, project } = this.getFileAndProject(args);
194035+ getCopilotRelatedInfo() {
194062194036 return {
194063- relatedFiles: project.getLanguageService().getImports(file)
194037+ relatedFiles: []
194064194038 };
194065194039 }
194066194040 setCompilerOptionsForInferredProjects(args) {
0 commit comments