typescript 5.7.0-dev.20241105 → 5.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_tsc.js +2 -4
- package/lib/typescript.d.ts +0 -11
- package/lib/typescript.js +18 -46
- package/package.json +2 -2
package/lib/_tsc.js
CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
18
18
|
|
19
19
|
// src/compiler/corePublic.ts
|
20
20
|
var versionMajorMinor = "5.7";
|
21
|
-
var version =
|
21
|
+
var version = "5.7.2";
|
22
22
|
|
23
23
|
// src/compiler/core.ts
|
24
24
|
var emptyArray = [];
|
@@ -15067,7 +15067,7 @@ function tryGetModuleSpecifierFromDeclaration(node) {
|
|
15067
15067
|
}
|
15068
15068
|
}
|
15069
15069
|
function shouldRewriteModuleSpecifier(specifier, compilerOptions) {
|
15070
|
-
return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier);
|
15070
|
+
return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier) && hasTSFileExtension(specifier);
|
15071
15071
|
}
|
15072
15072
|
function getExternalModuleName(node) {
|
15073
15073
|
switch (node.kind) {
|
@@ -78590,8 +78590,6 @@ function createTypeChecker(host) {
|
|
78590
78590
|
case 56 /* AmpersandAmpersandToken */:
|
78591
78591
|
case 77 /* AmpersandAmpersandEqualsToken */:
|
78592
78592
|
return 3 /* Sometimes */;
|
78593
|
-
case 28 /* CommaToken */:
|
78594
|
-
return getSyntacticNullishnessSemantics(node.right);
|
78595
78593
|
}
|
78596
78594
|
return 2 /* Never */;
|
78597
78595
|
case 227 /* ConditionalExpression */:
|
package/lib/typescript.d.ts
CHANGED
@@ -123,7 +123,6 @@ declare namespace ts {
|
|
123
123
|
ProvideInlayHints = "provideInlayHints",
|
124
124
|
WatchChange = "watchChange",
|
125
125
|
MapCode = "mapCode",
|
126
|
-
CopilotRelated = "copilotRelated",
|
127
126
|
}
|
128
127
|
/**
|
129
128
|
* A TypeScript Server message
|
@@ -1831,16 +1830,6 @@ declare namespace ts {
|
|
1831
1830
|
export interface MapCodeResponse extends Response {
|
1832
1831
|
body: readonly FileCodeEdits[];
|
1833
1832
|
}
|
1834
|
-
export interface CopilotRelatedRequest extends FileRequest {
|
1835
|
-
command: CommandTypes.CopilotRelated;
|
1836
|
-
arguments: FileRequestArgs;
|
1837
|
-
}
|
1838
|
-
export interface CopilotRelatedItems {
|
1839
|
-
relatedFiles: readonly string[];
|
1840
|
-
}
|
1841
|
-
export interface CopilotRelatedResponse extends Response {
|
1842
|
-
body: CopilotRelatedItems;
|
1843
|
-
}
|
1844
1833
|
/**
|
1845
1834
|
* Synchronous request for semantic diagnostics of one file.
|
1846
1835
|
*/
|
package/lib/typescript.js
CHANGED
@@ -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 =
|
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";
|
@@ -18774,7 +18774,7 @@ function tryGetImportFromModuleSpecifier(node) {
|
|
18774
18774
|
}
|
18775
18775
|
}
|
18776
18776
|
function shouldRewriteModuleSpecifier(specifier, compilerOptions) {
|
18777
|
-
return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier);
|
18777
|
+
return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier) && hasTSFileExtension(specifier);
|
18778
18778
|
}
|
18779
18779
|
function getExternalModuleName(node) {
|
18780
18780
|
switch (node.kind) {
|
@@ -83193,8 +83193,6 @@ function createTypeChecker(host) {
|
|
83193
83193
|
case 56 /* AmpersandAmpersandToken */:
|
83194
83194
|
case 77 /* AmpersandAmpersandEqualsToken */:
|
83195
83195
|
return 3 /* Sometimes */;
|
83196
|
-
case 28 /* CommaToken */:
|
83197
|
-
return getSyntacticNullishnessSemantics(node.right);
|
83198
83196
|
}
|
83199
83197
|
return 2 /* Never */;
|
83200
83198
|
case 227 /* ConditionalExpression */:
|
@@ -146432,23 +146430,22 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
|
|
146432
146430
|
const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
|
146433
146431
|
for (const statement of toMove) {
|
146434
146432
|
forEachReference(statement, checker, enclosingRange, (symbol, isValidTypeOnlyUseSite) => {
|
146435
|
-
if (!symbol.declarations
|
146433
|
+
if (!symbol.declarations) {
|
146436
146434
|
return;
|
146437
146435
|
}
|
146438
146436
|
if (existingTargetLocals.has(skipAlias(symbol, checker))) {
|
146439
146437
|
unusedImportsFromOldFile.add(symbol);
|
146440
146438
|
return;
|
146441
146439
|
}
|
146442
|
-
|
146443
|
-
|
146444
|
-
|
146445
|
-
|
146446
|
-
|
146447
|
-
|
146448
|
-
|
146449
|
-
|
146450
|
-
|
146451
|
-
}
|
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);
|
146452
146449
|
}
|
146453
146450
|
});
|
146454
146451
|
}
|
@@ -146482,16 +146479,6 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
|
|
146482
146479
|
return !!jsxNamespaceSymbol2 && some(jsxNamespaceSymbol2.declarations, isInImport) ? jsxNamespaceSymbol2 : void 0;
|
146483
146480
|
}
|
146484
146481
|
}
|
146485
|
-
function isGlobalType(checker, symbol) {
|
146486
|
-
return !!checker.resolveName(
|
146487
|
-
symbol.name,
|
146488
|
-
/*location*/
|
146489
|
-
void 0,
|
146490
|
-
788968 /* Type */,
|
146491
|
-
/*excludeGlobals*/
|
146492
|
-
false
|
146493
|
-
);
|
146494
|
-
}
|
146495
146482
|
function makeUniqueFilename(proposedFilename, extension, inDirectory, host) {
|
146496
146483
|
let newFilename = proposedFilename;
|
146497
146484
|
for (let i = 1; ; i++) {
|
@@ -151314,8 +151301,7 @@ var invalidOperationsInPartialSemanticMode = [
|
|
151314
151301
|
"provideCallHierarchyOutgoingCalls",
|
151315
151302
|
"provideInlayHints",
|
151316
151303
|
"getSupportedCodeFixes",
|
151317
|
-
"getPasteEdits"
|
151318
|
-
"getImports"
|
151304
|
+
"getPasteEdits"
|
151319
151305
|
];
|
151320
151306
|
var invalidOperationsInSyntacticMode = [
|
151321
151307
|
...invalidOperationsInPartialSemanticMode,
|
@@ -152567,18 +152553,6 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
152567
152553
|
preferences
|
152568
152554
|
);
|
152569
152555
|
}
|
152570
|
-
function getImports(fileName) {
|
152571
|
-
var _a2, _b;
|
152572
|
-
synchronizeHostData();
|
152573
|
-
const file = getValidSourceFile(fileName);
|
152574
|
-
let imports;
|
152575
|
-
for (const specifier of file.imports) {
|
152576
|
-
if (nodeIsSynthesized(specifier)) continue;
|
152577
|
-
const name = (_b = (_a2 = program.getResolvedModuleFromModuleSpecifier(specifier, file)) == null ? void 0 : _a2.resolvedModule) == null ? void 0 : _b.resolvedFileName;
|
152578
|
-
if (name) (imports ?? (imports = /* @__PURE__ */ new Set())).add(name);
|
152579
|
-
}
|
152580
|
-
return imports ? arrayFrom(imports) : emptyArray;
|
152581
|
-
}
|
152582
152556
|
const ls = {
|
152583
152557
|
dispose,
|
152584
152558
|
cleanupSemanticCache,
|
@@ -152652,8 +152626,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
152652
152626
|
getSupportedCodeFixes,
|
152653
152627
|
preparePasteEditsForFile,
|
152654
152628
|
getPasteEdits,
|
152655
|
-
mapCode: mapCode2
|
152656
|
-
getImports
|
152629
|
+
mapCode: mapCode2
|
152657
152630
|
};
|
152658
152631
|
switch (languageServiceMode) {
|
152659
152632
|
case 0 /* Semantic */:
|
@@ -193110,8 +193083,8 @@ var Session3 = class _Session {
|
|
193110
193083
|
["mapCode" /* MapCode */]: (request) => {
|
193111
193084
|
return this.requiredResponse(this.mapCode(request.arguments));
|
193112
193085
|
},
|
193113
|
-
["copilotRelated" /* CopilotRelated */]: (
|
193114
|
-
return this.requiredResponse(this.getCopilotRelatedInfo(
|
193086
|
+
["copilotRelated" /* CopilotRelated */]: () => {
|
193087
|
+
return this.requiredResponse(this.getCopilotRelatedInfo());
|
193115
193088
|
}
|
193116
193089
|
}));
|
193117
193090
|
this.host = opts.host;
|
@@ -194059,10 +194032,9 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
194059
194032
|
const changes = languageService.mapCode(file, args.mapping.contents, focusLocations, formatOptions, preferences);
|
194060
194033
|
return this.mapTextChangesToCodeEdits(changes);
|
194061
194034
|
}
|
194062
|
-
getCopilotRelatedInfo(
|
194063
|
-
const { file, project } = this.getFileAndProject(args);
|
194035
|
+
getCopilotRelatedInfo() {
|
194064
194036
|
return {
|
194065
|
-
relatedFiles:
|
194037
|
+
relatedFiles: []
|
194066
194038
|
};
|
194067
194039
|
}
|
194068
194040
|
setCompilerOptionsForInferredProjects(args) {
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "typescript",
|
3
3
|
"author": "Microsoft Corp.",
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
5
|
-
"version": "5.7.
|
5
|
+
"version": "5.7.2",
|
6
6
|
"license": "Apache-2.0",
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
8
8
|
"keywords": [
|
@@ -116,5 +116,5 @@
|
|
116
116
|
"node": "20.1.0",
|
117
117
|
"npm": "8.19.4"
|
118
118
|
},
|
119
|
-
"gitHead": "
|
119
|
+
"gitHead": "d701d908d534e68cfab24b6df15539014ac348a3"
|
120
120
|
}
|