@@ -2278,7 +2278,7 @@ module.exports = __toCommonJS(typescript_exports);
2278
2278
2279
2279
// src/compiler/corePublic.ts
2280
2280
var versionMajorMinor = "5.7";
2281
- var version = "5.7.1-rc ";
2281
+ var version = "5.7.2 ";
2282
2282
var Comparison = /* @__PURE__ */ ((Comparison3) => {
2283
2283
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2284
2284
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -146430,23 +146430,22 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
146430
146430
const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
146431
146431
for (const statement of toMove) {
146432
146432
forEachReference(statement, checker, enclosingRange, (symbol, isValidTypeOnlyUseSite) => {
146433
- if (!symbol.declarations || isGlobalType(checker, symbol) ) {
146433
+ if (!symbol.declarations) {
146434
146434
return;
146435
146435
}
146436
146436
if (existingTargetLocals.has(skipAlias(symbol, checker))) {
146437
146437
unusedImportsFromOldFile.add(symbol);
146438
146438
return;
146439
146439
}
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);
146450
146449
}
146451
146450
});
146452
146451
}
@@ -146480,16 +146479,6 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
146480
146479
return !!jsxNamespaceSymbol2 && some(jsxNamespaceSymbol2.declarations, isInImport) ? jsxNamespaceSymbol2 : void 0;
146481
146480
}
146482
146481
}
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
- }
146493
146482
function makeUniqueFilename(proposedFilename, extension, inDirectory, host) {
146494
146483
let newFilename = proposedFilename;
146495
146484
for (let i = 1; ; i++) {
@@ -151312,8 +151301,7 @@ var invalidOperationsInPartialSemanticMode = [
151312
151301
"provideCallHierarchyOutgoingCalls",
151313
151302
"provideInlayHints",
151314
151303
"getSupportedCodeFixes",
151315
- "getPasteEdits",
151316
- "getImports"
151304
+ "getPasteEdits"
151317
151305
];
151318
151306
var invalidOperationsInSyntacticMode = [
151319
151307
...invalidOperationsInPartialSemanticMode,
@@ -152565,18 +152553,6 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
152565
152553
preferences
152566
152554
);
152567
152555
}
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
- }
152580
152556
const ls = {
152581
152557
dispose,
152582
152558
cleanupSemanticCache,
@@ -152650,8 +152626,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
152650
152626
getSupportedCodeFixes,
152651
152627
preparePasteEditsForFile,
152652
152628
getPasteEdits,
152653
- mapCode: mapCode2,
152654
- getImports
152629
+ mapCode: mapCode2
152655
152630
};
152656
152631
switch (languageServiceMode) {
152657
152632
case 0 /* Semantic */:
@@ -193108,8 +193083,8 @@ var Session3 = class _Session {
193108
193083
["mapCode" /* MapCode */]: (request) => {
193109
193084
return this.requiredResponse(this.mapCode(request.arguments));
193110
193085
},
193111
- ["copilotRelated" /* CopilotRelated */]: (request ) => {
193112
- return this.requiredResponse(this.getCopilotRelatedInfo(request.arguments ));
193086
+ ["copilotRelated" /* CopilotRelated */]: () => {
193087
+ return this.requiredResponse(this.getCopilotRelatedInfo());
193113
193088
}
193114
193089
}));
193115
193090
this.host = opts.host;
@@ -194057,10 +194032,9 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
194057
194032
const changes = languageService.mapCode(file, args.mapping.contents, focusLocations, formatOptions, preferences);
194058
194033
return this.mapTextChangesToCodeEdits(changes);
194059
194034
}
194060
- getCopilotRelatedInfo(args) {
194061
- const { file, project } = this.getFileAndProject(args);
194035
+ getCopilotRelatedInfo() {
194062
194036
return {
194063
- relatedFiles: project.getLanguageService().getImports(file)
194037
+ relatedFiles: []
194064
194038
};
194065
194039
}
194066
194040
setCompilerOptionsForInferredProjects(args) {
0 commit comments