typescript 5.1.0-dev.20230305 → 5.1.0-dev.20230307
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 +11 -4
- package/lib/tsserver.js +30 -5
- package/lib/tsserverlibrary.js +30 -5
- package/lib/typescript.js +30 -5
- package/lib/typingsInstaller.js +21 -3698
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.1";
|
|
26
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
26
|
+
var version = `${versionMajorMinor}.0-dev.20230307`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -12382,7 +12382,7 @@ function getErrorSpanForArrowFunction(sourceFile, node) {
|
|
|
12382
12382
|
function getErrorSpanForNode(sourceFile, node) {
|
|
12383
12383
|
let errorNode = node;
|
|
12384
12384
|
switch (node.kind) {
|
|
12385
|
-
case 308 /* SourceFile */:
|
|
12385
|
+
case 308 /* SourceFile */: {
|
|
12386
12386
|
const pos2 = skipTrivia(
|
|
12387
12387
|
sourceFile.text,
|
|
12388
12388
|
0,
|
|
@@ -12393,6 +12393,7 @@ function getErrorSpanForNode(sourceFile, node) {
|
|
|
12393
12393
|
return createTextSpan(0, 0);
|
|
12394
12394
|
}
|
|
12395
12395
|
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
12396
|
+
}
|
|
12396
12397
|
case 257 /* VariableDeclaration */:
|
|
12397
12398
|
case 205 /* BindingElement */:
|
|
12398
12399
|
case 260 /* ClassDeclaration */:
|
|
@@ -12415,10 +12416,16 @@ function getErrorSpanForNode(sourceFile, node) {
|
|
|
12415
12416
|
case 216 /* ArrowFunction */:
|
|
12416
12417
|
return getErrorSpanForArrowFunction(sourceFile, node);
|
|
12417
12418
|
case 292 /* CaseClause */:
|
|
12418
|
-
case 293 /* DefaultClause */:
|
|
12419
|
+
case 293 /* DefaultClause */: {
|
|
12419
12420
|
const start = skipTrivia(sourceFile.text, node.pos);
|
|
12420
12421
|
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
|
|
12421
12422
|
return createTextSpanFromBounds(start, end);
|
|
12423
|
+
}
|
|
12424
|
+
case 250 /* ReturnStatement */:
|
|
12425
|
+
case 226 /* YieldExpression */: {
|
|
12426
|
+
const pos2 = skipTrivia(sourceFile.text, node.pos);
|
|
12427
|
+
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
12428
|
+
}
|
|
12422
12429
|
}
|
|
12423
12430
|
if (errorNode === void 0) {
|
|
12424
12431
|
return getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
@@ -38833,7 +38840,7 @@ function initFlowNode(node) {
|
|
|
38833
38840
|
Debug.attachFlowNodeDebugInfo(node);
|
|
38834
38841
|
return node;
|
|
38835
38842
|
}
|
|
38836
|
-
var binder = createBinder();
|
|
38843
|
+
var binder = /* @__PURE__ */ createBinder();
|
|
38837
38844
|
function bindSourceFile(file, options) {
|
|
38838
38845
|
mark("beforeBind");
|
|
38839
38846
|
perfLogger.logStartBindFile("" + file.fileName);
|
package/lib/tsserver.js
CHANGED
|
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2286
2286
|
|
|
2287
2287
|
// src/compiler/corePublic.ts
|
|
2288
2288
|
var versionMajorMinor = "5.1";
|
|
2289
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2289
|
+
var version = `${versionMajorMinor}.0-dev.20230307`;
|
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -16143,7 +16143,7 @@ function getErrorSpanForArrowFunction(sourceFile, node) {
|
|
|
16143
16143
|
function getErrorSpanForNode(sourceFile, node) {
|
|
16144
16144
|
let errorNode = node;
|
|
16145
16145
|
switch (node.kind) {
|
|
16146
|
-
case 308 /* SourceFile */:
|
|
16146
|
+
case 308 /* SourceFile */: {
|
|
16147
16147
|
const pos2 = skipTrivia(
|
|
16148
16148
|
sourceFile.text,
|
|
16149
16149
|
0,
|
|
@@ -16154,6 +16154,7 @@ function getErrorSpanForNode(sourceFile, node) {
|
|
|
16154
16154
|
return createTextSpan(0, 0);
|
|
16155
16155
|
}
|
|
16156
16156
|
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
16157
|
+
}
|
|
16157
16158
|
case 257 /* VariableDeclaration */:
|
|
16158
16159
|
case 205 /* BindingElement */:
|
|
16159
16160
|
case 260 /* ClassDeclaration */:
|
|
@@ -16176,10 +16177,16 @@ function getErrorSpanForNode(sourceFile, node) {
|
|
|
16176
16177
|
case 216 /* ArrowFunction */:
|
|
16177
16178
|
return getErrorSpanForArrowFunction(sourceFile, node);
|
|
16178
16179
|
case 292 /* CaseClause */:
|
|
16179
|
-
case 293 /* DefaultClause */:
|
|
16180
|
+
case 293 /* DefaultClause */: {
|
|
16180
16181
|
const start2 = skipTrivia(sourceFile.text, node.pos);
|
|
16181
16182
|
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
|
|
16182
16183
|
return createTextSpanFromBounds(start2, end);
|
|
16184
|
+
}
|
|
16185
|
+
case 250 /* ReturnStatement */:
|
|
16186
|
+
case 226 /* YieldExpression */: {
|
|
16187
|
+
const pos2 = skipTrivia(sourceFile.text, node.pos);
|
|
16188
|
+
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
16189
|
+
}
|
|
16183
16190
|
}
|
|
16184
16191
|
if (errorNode === void 0) {
|
|
16185
16192
|
return getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
@@ -43390,7 +43397,7 @@ function initFlowNode(node) {
|
|
|
43390
43397
|
Debug.attachFlowNodeDebugInfo(node);
|
|
43391
43398
|
return node;
|
|
43392
43399
|
}
|
|
43393
|
-
var binder = createBinder();
|
|
43400
|
+
var binder = /* @__PURE__ */ createBinder();
|
|
43394
43401
|
function bindSourceFile(file, options) {
|
|
43395
43402
|
mark("beforeBind");
|
|
43396
43403
|
perfLogger.logStartBindFile("" + file.fileName);
|
|
@@ -145106,7 +145113,7 @@ registerCodeFix({
|
|
|
145106
145113
|
];
|
|
145107
145114
|
}
|
|
145108
145115
|
return [
|
|
145109
|
-
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => t
|
|
145116
|
+
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteDestructuring(context, t, sourceFile, token.parent)), Diagnostics.Remove_unused_destructuring_declaration)
|
|
145110
145117
|
];
|
|
145111
145118
|
}
|
|
145112
145119
|
if (canDeleteEntireVariableStatement(sourceFile, token)) {
|
|
@@ -145239,6 +145246,24 @@ function deleteEntireVariableStatement(changes, sourceFile, node) {
|
|
|
145239
145246
|
function deleteDestructuringElements(changes, sourceFile, node) {
|
|
145240
145247
|
forEach(node.elements, (n) => changes.delete(sourceFile, n));
|
|
145241
145248
|
}
|
|
145249
|
+
function deleteDestructuring(context, changes, sourceFile, { parent: parent2 }) {
|
|
145250
|
+
if (isVariableDeclaration(parent2) && parent2.initializer && isCallLikeExpression(parent2.initializer)) {
|
|
145251
|
+
if (isVariableDeclarationList(parent2.parent) && length(parent2.parent.declarations) > 1) {
|
|
145252
|
+
const varStatement = parent2.parent.parent;
|
|
145253
|
+
const pos = varStatement.getStart(sourceFile);
|
|
145254
|
+
const end = varStatement.end;
|
|
145255
|
+
changes.delete(sourceFile, parent2);
|
|
145256
|
+
changes.insertNodeAt(sourceFile, end, parent2.initializer, {
|
|
145257
|
+
prefix: getNewLineOrDefaultFromHost(context.host, context.formatContext.options) + sourceFile.text.slice(getPrecedingNonSpaceCharacterPosition(sourceFile.text, pos - 1), pos),
|
|
145258
|
+
suffix: probablyUsesSemicolons(sourceFile) ? ";" : ""
|
|
145259
|
+
});
|
|
145260
|
+
} else {
|
|
145261
|
+
changes.replaceNode(sourceFile, parent2.parent, parent2.initializer);
|
|
145262
|
+
}
|
|
145263
|
+
} else {
|
|
145264
|
+
changes.delete(sourceFile, parent2);
|
|
145265
|
+
}
|
|
145266
|
+
}
|
|
145242
145267
|
function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {
|
|
145243
145268
|
if (errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code)
|
|
145244
145269
|
return;
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230307`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -13970,7 +13970,7 @@ ${lanes.join("\n")}
|
|
|
13970
13970
|
function getErrorSpanForNode(sourceFile, node) {
|
|
13971
13971
|
let errorNode = node;
|
|
13972
13972
|
switch (node.kind) {
|
|
13973
|
-
case 308 /* SourceFile */:
|
|
13973
|
+
case 308 /* SourceFile */: {
|
|
13974
13974
|
const pos2 = skipTrivia(
|
|
13975
13975
|
sourceFile.text,
|
|
13976
13976
|
0,
|
|
@@ -13981,6 +13981,7 @@ ${lanes.join("\n")}
|
|
|
13981
13981
|
return createTextSpan(0, 0);
|
|
13982
13982
|
}
|
|
13983
13983
|
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
13984
|
+
}
|
|
13984
13985
|
case 257 /* VariableDeclaration */:
|
|
13985
13986
|
case 205 /* BindingElement */:
|
|
13986
13987
|
case 260 /* ClassDeclaration */:
|
|
@@ -14003,10 +14004,16 @@ ${lanes.join("\n")}
|
|
|
14003
14004
|
case 216 /* ArrowFunction */:
|
|
14004
14005
|
return getErrorSpanForArrowFunction(sourceFile, node);
|
|
14005
14006
|
case 292 /* CaseClause */:
|
|
14006
|
-
case 293 /* DefaultClause */:
|
|
14007
|
+
case 293 /* DefaultClause */: {
|
|
14007
14008
|
const start = skipTrivia(sourceFile.text, node.pos);
|
|
14008
14009
|
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
|
|
14009
14010
|
return createTextSpanFromBounds(start, end);
|
|
14011
|
+
}
|
|
14012
|
+
case 250 /* ReturnStatement */:
|
|
14013
|
+
case 226 /* YieldExpression */: {
|
|
14014
|
+
const pos2 = skipTrivia(sourceFile.text, node.pos);
|
|
14015
|
+
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
14016
|
+
}
|
|
14010
14017
|
}
|
|
14011
14018
|
if (errorNode === void 0) {
|
|
14012
14019
|
return getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
@@ -44053,7 +44060,7 @@ ${lanes.join("\n")}
|
|
|
44053
44060
|
ModuleInstanceState2[ModuleInstanceState2["ConstEnumOnly"] = 2] = "ConstEnumOnly";
|
|
44054
44061
|
return ModuleInstanceState2;
|
|
44055
44062
|
})(ModuleInstanceState || {});
|
|
44056
|
-
binder = createBinder();
|
|
44063
|
+
binder = /* @__PURE__ */ createBinder();
|
|
44057
44064
|
}
|
|
44058
44065
|
});
|
|
44059
44066
|
|
|
@@ -143873,6 +143880,24 @@ ${lanes.join("\n")}
|
|
|
143873
143880
|
function deleteDestructuringElements(changes, sourceFile, node) {
|
|
143874
143881
|
forEach(node.elements, (n) => changes.delete(sourceFile, n));
|
|
143875
143882
|
}
|
|
143883
|
+
function deleteDestructuring(context, changes, sourceFile, { parent: parent2 }) {
|
|
143884
|
+
if (isVariableDeclaration(parent2) && parent2.initializer && isCallLikeExpression(parent2.initializer)) {
|
|
143885
|
+
if (isVariableDeclarationList(parent2.parent) && length(parent2.parent.declarations) > 1) {
|
|
143886
|
+
const varStatement = parent2.parent.parent;
|
|
143887
|
+
const pos = varStatement.getStart(sourceFile);
|
|
143888
|
+
const end = varStatement.end;
|
|
143889
|
+
changes.delete(sourceFile, parent2);
|
|
143890
|
+
changes.insertNodeAt(sourceFile, end, parent2.initializer, {
|
|
143891
|
+
prefix: getNewLineOrDefaultFromHost(context.host, context.formatContext.options) + sourceFile.text.slice(getPrecedingNonSpaceCharacterPosition(sourceFile.text, pos - 1), pos),
|
|
143892
|
+
suffix: probablyUsesSemicolons(sourceFile) ? ";" : ""
|
|
143893
|
+
});
|
|
143894
|
+
} else {
|
|
143895
|
+
changes.replaceNode(sourceFile, parent2.parent, parent2.initializer);
|
|
143896
|
+
}
|
|
143897
|
+
} else {
|
|
143898
|
+
changes.delete(sourceFile, parent2);
|
|
143899
|
+
}
|
|
143900
|
+
}
|
|
143876
143901
|
function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {
|
|
143877
143902
|
if (errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code)
|
|
143878
143903
|
return;
|
|
@@ -144062,7 +144087,7 @@ ${lanes.join("\n")}
|
|
|
144062
144087
|
];
|
|
144063
144088
|
}
|
|
144064
144089
|
return [
|
|
144065
|
-
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => t
|
|
144090
|
+
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteDestructuring(context, t, sourceFile, token.parent)), Diagnostics.Remove_unused_destructuring_declaration)
|
|
144066
144091
|
];
|
|
144067
144092
|
}
|
|
144068
144093
|
if (canDeleteEntireVariableStatement(sourceFile, token)) {
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230307`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -13970,7 +13970,7 @@ ${lanes.join("\n")}
|
|
|
13970
13970
|
function getErrorSpanForNode(sourceFile, node) {
|
|
13971
13971
|
let errorNode = node;
|
|
13972
13972
|
switch (node.kind) {
|
|
13973
|
-
case 308 /* SourceFile */:
|
|
13973
|
+
case 308 /* SourceFile */: {
|
|
13974
13974
|
const pos2 = skipTrivia(
|
|
13975
13975
|
sourceFile.text,
|
|
13976
13976
|
0,
|
|
@@ -13981,6 +13981,7 @@ ${lanes.join("\n")}
|
|
|
13981
13981
|
return createTextSpan(0, 0);
|
|
13982
13982
|
}
|
|
13983
13983
|
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
13984
|
+
}
|
|
13984
13985
|
case 257 /* VariableDeclaration */:
|
|
13985
13986
|
case 205 /* BindingElement */:
|
|
13986
13987
|
case 260 /* ClassDeclaration */:
|
|
@@ -14003,10 +14004,16 @@ ${lanes.join("\n")}
|
|
|
14003
14004
|
case 216 /* ArrowFunction */:
|
|
14004
14005
|
return getErrorSpanForArrowFunction(sourceFile, node);
|
|
14005
14006
|
case 292 /* CaseClause */:
|
|
14006
|
-
case 293 /* DefaultClause */:
|
|
14007
|
+
case 293 /* DefaultClause */: {
|
|
14007
14008
|
const start = skipTrivia(sourceFile.text, node.pos);
|
|
14008
14009
|
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
|
|
14009
14010
|
return createTextSpanFromBounds(start, end);
|
|
14011
|
+
}
|
|
14012
|
+
case 250 /* ReturnStatement */:
|
|
14013
|
+
case 226 /* YieldExpression */: {
|
|
14014
|
+
const pos2 = skipTrivia(sourceFile.text, node.pos);
|
|
14015
|
+
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
14016
|
+
}
|
|
14010
14017
|
}
|
|
14011
14018
|
if (errorNode === void 0) {
|
|
14012
14019
|
return getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
@@ -44053,7 +44060,7 @@ ${lanes.join("\n")}
|
|
|
44053
44060
|
ModuleInstanceState2[ModuleInstanceState2["ConstEnumOnly"] = 2] = "ConstEnumOnly";
|
|
44054
44061
|
return ModuleInstanceState2;
|
|
44055
44062
|
})(ModuleInstanceState || {});
|
|
44056
|
-
binder = createBinder();
|
|
44063
|
+
binder = /* @__PURE__ */ createBinder();
|
|
44057
44064
|
}
|
|
44058
44065
|
});
|
|
44059
44066
|
|
|
@@ -143887,6 +143894,24 @@ ${lanes.join("\n")}
|
|
|
143887
143894
|
function deleteDestructuringElements(changes, sourceFile, node) {
|
|
143888
143895
|
forEach(node.elements, (n) => changes.delete(sourceFile, n));
|
|
143889
143896
|
}
|
|
143897
|
+
function deleteDestructuring(context, changes, sourceFile, { parent: parent2 }) {
|
|
143898
|
+
if (isVariableDeclaration(parent2) && parent2.initializer && isCallLikeExpression(parent2.initializer)) {
|
|
143899
|
+
if (isVariableDeclarationList(parent2.parent) && length(parent2.parent.declarations) > 1) {
|
|
143900
|
+
const varStatement = parent2.parent.parent;
|
|
143901
|
+
const pos = varStatement.getStart(sourceFile);
|
|
143902
|
+
const end = varStatement.end;
|
|
143903
|
+
changes.delete(sourceFile, parent2);
|
|
143904
|
+
changes.insertNodeAt(sourceFile, end, parent2.initializer, {
|
|
143905
|
+
prefix: getNewLineOrDefaultFromHost(context.host, context.formatContext.options) + sourceFile.text.slice(getPrecedingNonSpaceCharacterPosition(sourceFile.text, pos - 1), pos),
|
|
143906
|
+
suffix: probablyUsesSemicolons(sourceFile) ? ";" : ""
|
|
143907
|
+
});
|
|
143908
|
+
} else {
|
|
143909
|
+
changes.replaceNode(sourceFile, parent2.parent, parent2.initializer);
|
|
143910
|
+
}
|
|
143911
|
+
} else {
|
|
143912
|
+
changes.delete(sourceFile, parent2);
|
|
143913
|
+
}
|
|
143914
|
+
}
|
|
143890
143915
|
function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {
|
|
143891
143916
|
if (errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code)
|
|
143892
143917
|
return;
|
|
@@ -144076,7 +144101,7 @@ ${lanes.join("\n")}
|
|
|
144076
144101
|
];
|
|
144077
144102
|
}
|
|
144078
144103
|
return [
|
|
144079
|
-
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => t
|
|
144104
|
+
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteDestructuring(context, t, sourceFile, token.parent)), Diagnostics.Remove_unused_destructuring_declaration)
|
|
144080
144105
|
];
|
|
144081
144106
|
}
|
|
144082
144107
|
if (canDeleteEntireVariableStatement(sourceFile, token)) {
|