typescript 4.7.0-dev.20220307 → 4.7.0-dev.20220308
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 +8 -4
- package/lib/tsserver.js +131 -85
- package/lib/tsserverlibrary.js +131 -85
- package/lib/typescript.js +8 -4
- package/lib/typescriptServices.js +8 -4
- package/lib/typingsInstaller.js +8 -4
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220308";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -11330,7 +11330,7 @@ var ts;
|
|
|
11330
11330
|
return name.kind === 161 && !isStringOrNumericLiteralLike(name.expression);
|
|
11331
11331
|
}
|
|
11332
11332
|
ts.isComputedNonLiteralName = isComputedNonLiteralName;
|
|
11333
|
-
function
|
|
11333
|
+
function tryGetTextOfPropertyName(name) {
|
|
11334
11334
|
switch (name.kind) {
|
|
11335
11335
|
case 79:
|
|
11336
11336
|
case 80:
|
|
@@ -11342,11 +11342,15 @@ var ts;
|
|
|
11342
11342
|
case 161:
|
|
11343
11343
|
if (isStringOrNumericLiteralLike(name.expression))
|
|
11344
11344
|
return ts.escapeLeadingUnderscores(name.expression.text);
|
|
11345
|
-
return
|
|
11345
|
+
return undefined;
|
|
11346
11346
|
default:
|
|
11347
11347
|
return ts.Debug.assertNever(name);
|
|
11348
11348
|
}
|
|
11349
11349
|
}
|
|
11350
|
+
ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
|
|
11351
|
+
function getTextOfPropertyName(name) {
|
|
11352
|
+
return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
|
|
11353
|
+
}
|
|
11350
11354
|
ts.getTextOfPropertyName = getTextOfPropertyName;
|
|
11351
11355
|
function entityNameToString(name) {
|
|
11352
11356
|
switch (name.kind) {
|
|
@@ -11863,7 +11867,7 @@ var ts;
|
|
|
11863
11867
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
11864
11868
|
return objectLiteral.properties.filter(function (property) {
|
|
11865
11869
|
if (property.kind === 295) {
|
|
11866
|
-
var propName =
|
|
11870
|
+
var propName = tryGetTextOfPropertyName(property.name);
|
|
11867
11871
|
return key === propName || (!!key2 && key2 === propName);
|
|
11868
11872
|
}
|
|
11869
11873
|
return false;
|
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220308";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -14833,7 +14833,7 @@ var ts;
|
|
|
14833
14833
|
return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
|
|
14834
14834
|
}
|
|
14835
14835
|
ts.isComputedNonLiteralName = isComputedNonLiteralName;
|
|
14836
|
-
function
|
|
14836
|
+
function tryGetTextOfPropertyName(name) {
|
|
14837
14837
|
switch (name.kind) {
|
|
14838
14838
|
case 79 /* Identifier */:
|
|
14839
14839
|
case 80 /* PrivateIdentifier */:
|
|
@@ -14845,11 +14845,15 @@ var ts;
|
|
|
14845
14845
|
case 161 /* ComputedPropertyName */:
|
|
14846
14846
|
if (isStringOrNumericLiteralLike(name.expression))
|
|
14847
14847
|
return ts.escapeLeadingUnderscores(name.expression.text);
|
|
14848
|
-
return
|
|
14848
|
+
return undefined;
|
|
14849
14849
|
default:
|
|
14850
14850
|
return ts.Debug.assertNever(name);
|
|
14851
14851
|
}
|
|
14852
14852
|
}
|
|
14853
|
+
ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
|
|
14854
|
+
function getTextOfPropertyName(name) {
|
|
14855
|
+
return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
|
|
14856
|
+
}
|
|
14853
14857
|
ts.getTextOfPropertyName = getTextOfPropertyName;
|
|
14854
14858
|
function entityNameToString(name) {
|
|
14855
14859
|
switch (name.kind) {
|
|
@@ -15401,7 +15405,7 @@ var ts;
|
|
|
15401
15405
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
15402
15406
|
return objectLiteral.properties.filter(function (property) {
|
|
15403
15407
|
if (property.kind === 295 /* PropertyAssignment */) {
|
|
15404
|
-
var propName =
|
|
15408
|
+
var propName = tryGetTextOfPropertyName(property.name);
|
|
15405
15409
|
return key === propName || (!!key2 && key2 === propName);
|
|
15406
15410
|
}
|
|
15407
15411
|
return false;
|
|
@@ -172425,47 +172429,18 @@ var ts;
|
|
|
172425
172429
|
}
|
|
172426
172430
|
return ts.deduplicate(outputs, ts.equateValues);
|
|
172427
172431
|
}
|
|
172428
|
-
|
|
172429
|
-
|
|
172430
|
-
|
|
172431
|
-
return ts.contains(result, output, areEqual);
|
|
172432
|
-
});
|
|
172433
|
-
}
|
|
172434
|
-
function addToCombineOutputResult(outputs, project, result) {
|
|
172435
|
-
if (result.length)
|
|
172436
|
-
outputs.push({ project: project, result: result });
|
|
172437
|
-
}
|
|
172438
|
-
function combineProjectOutputFromEveryProject(projectService, action, areEqual) {
|
|
172439
|
-
var outputs = [];
|
|
172440
|
-
projectService.loadAncestorProjectTree();
|
|
172441
|
-
projectService.forEachEnabledProject(function (project) {
|
|
172442
|
-
var theseOutputs = action(project);
|
|
172443
|
-
addToCombineOutputResult(outputs, project, ts.filter(theseOutputs, function (output) { return !combineOutputResultContains(outputs, output, areEqual); }));
|
|
172444
|
-
});
|
|
172445
|
-
return outputs;
|
|
172446
|
-
}
|
|
172447
|
-
function flattenCombineOutputResult(outputs) {
|
|
172448
|
-
return ts.flatMap(outputs, function (_a) {
|
|
172449
|
-
var result = _a.result;
|
|
172450
|
-
return result;
|
|
172451
|
-
});
|
|
172452
|
-
}
|
|
172453
|
-
function combineProjectOutputWhileOpeningReferencedProjects(projects, defaultProject, action, getLocation, resultsEqual) {
|
|
172454
|
-
var outputs = [];
|
|
172455
|
-
combineProjectOutputWorker(projects, defaultProject,
|
|
172456
|
-
/*initialLocation*/ undefined, function (project, _, tryAddToTodo) {
|
|
172457
|
-
var theseOutputs = action(project);
|
|
172458
|
-
addToCombineOutputResult(outputs, project, ts.filter(theseOutputs, function (output) { return !combineOutputResultContains(outputs, output, resultsEqual) && !tryAddToTodo(project, getLocation(output)); }));
|
|
172459
|
-
});
|
|
172460
|
-
return outputs;
|
|
172461
|
-
}
|
|
172462
|
-
function combineProjectOutputForRenameLocations(projects, defaultProject, initialLocation, findInStrings, findInComments, hostPreferences) {
|
|
172432
|
+
;
|
|
172433
|
+
function combineProjectOutputForRenameLocations(projects, defaultProject, initialLocation, findInStrings, findInComments, _a) {
|
|
172434
|
+
var providePrefixAndSuffixTextForRename = _a.providePrefixAndSuffixTextForRename;
|
|
172463
172435
|
var outputs = [];
|
|
172464
172436
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, tryAddToTodo) {
|
|
172465
|
-
|
|
172466
|
-
|
|
172467
|
-
|
|
172468
|
-
|
|
172437
|
+
var projectOutputs = project.getLanguageService().findRenameLocations(location.fileName, location.pos, findInStrings, findInComments, providePrefixAndSuffixTextForRename);
|
|
172438
|
+
if (projectOutputs) {
|
|
172439
|
+
for (var _i = 0, projectOutputs_1 = projectOutputs; _i < projectOutputs_1.length; _i++) {
|
|
172440
|
+
var output = projectOutputs_1[_i];
|
|
172441
|
+
if (!ts.contains(outputs, output, ts.documentSpansEqual) && !tryAddToTodo(project, documentSpanLocation(output))) {
|
|
172442
|
+
outputs.push(output);
|
|
172443
|
+
}
|
|
172469
172444
|
}
|
|
172470
172445
|
}
|
|
172471
172446
|
});
|
|
@@ -172480,43 +172455,33 @@ var ts;
|
|
|
172480
172455
|
var outputs = [];
|
|
172481
172456
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, getMappedLocation) {
|
|
172482
172457
|
logger.info("Finding references to " + location.fileName + " position " + location.pos + " in project " + project.getProjectName());
|
|
172483
|
-
var
|
|
172484
|
-
|
|
172485
|
-
var
|
|
172486
|
-
|
|
172487
|
-
|
|
172488
|
-
|
|
172489
|
-
symbolToAddTo = {
|
|
172490
|
-
|
|
172491
|
-
|
|
172492
|
-
|
|
172493
|
-
|
|
172494
|
-
|
|
172495
|
-
|
|
172496
|
-
|
|
172458
|
+
var projectOutputs = project.getLanguageService().findReferences(location.fileName, location.pos);
|
|
172459
|
+
if (projectOutputs) {
|
|
172460
|
+
var _loop_8 = function (referencedSymbol) {
|
|
172461
|
+
var mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(referencedSymbol.definition));
|
|
172462
|
+
var definition = mappedDefinitionFile === undefined ?
|
|
172463
|
+
referencedSymbol.definition : __assign(__assign({}, referencedSymbol.definition), { textSpan: ts.createTextSpan(mappedDefinitionFile.pos, referencedSymbol.definition.textSpan.length), fileName: mappedDefinitionFile.fileName, contextSpan: getMappedContextSpan(referencedSymbol.definition, project) });
|
|
172464
|
+
var symbolToAddTo = ts.find(outputs, function (o) { return ts.documentSpansEqual(o.definition, definition); });
|
|
172465
|
+
if (!symbolToAddTo) {
|
|
172466
|
+
symbolToAddTo = { definition: definition, references: [] };
|
|
172467
|
+
outputs.push(symbolToAddTo);
|
|
172468
|
+
}
|
|
172469
|
+
for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) {
|
|
172470
|
+
var ref = _b[_a];
|
|
172471
|
+
// If it's in a mapped file, that is added to the todo list by `getMappedLocation`.
|
|
172472
|
+
if (!ts.contains(symbolToAddTo.references, ref, ts.documentSpansEqual) && !getMappedLocation(project, documentSpanLocation(ref))) {
|
|
172473
|
+
symbolToAddTo.references.push(ref);
|
|
172474
|
+
}
|
|
172497
172475
|
}
|
|
172476
|
+
};
|
|
172477
|
+
for (var _i = 0, projectOutputs_2 = projectOutputs; _i < projectOutputs_2.length; _i++) {
|
|
172478
|
+
var referencedSymbol = projectOutputs_2[_i];
|
|
172479
|
+
_loop_8(referencedSymbol);
|
|
172498
172480
|
}
|
|
172499
|
-
};
|
|
172500
|
-
for (var _i = 0, _a = project.getLanguageService().findReferences(location.fileName, location.pos) || server.emptyArray; _i < _a.length; _i++) {
|
|
172501
|
-
var outputReferencedSymbol = _a[_i];
|
|
172502
|
-
_loop_8(outputReferencedSymbol);
|
|
172503
172481
|
}
|
|
172504
172482
|
});
|
|
172505
172483
|
return outputs.filter(function (o) { return o.references.length !== 0; });
|
|
172506
172484
|
}
|
|
172507
|
-
function combineProjectOutputForFileReferences(projects, defaultProject, fileName) {
|
|
172508
|
-
var outputs = [];
|
|
172509
|
-
combineProjectOutputWorker(projects, defaultProject,
|
|
172510
|
-
/*initialLocation*/ undefined, function (project) {
|
|
172511
|
-
for (var _i = 0, _a = project.getLanguageService().getFileReferences(fileName) || server.emptyArray; _i < _a.length; _i++) {
|
|
172512
|
-
var referenceEntry = _a[_i];
|
|
172513
|
-
if (!ts.contains(outputs, referenceEntry, ts.documentSpansEqual)) {
|
|
172514
|
-
outputs.push(referenceEntry);
|
|
172515
|
-
}
|
|
172516
|
-
}
|
|
172517
|
-
});
|
|
172518
|
-
return outputs;
|
|
172519
|
-
}
|
|
172520
172485
|
function forEachProjectInProjects(projects, path, cb) {
|
|
172521
172486
|
for (var _i = 0, _a = ts.isArray(projects) ? projects : projects.projects; _i < _a.length; _i++) {
|
|
172522
172487
|
var project = _a[_i];
|
|
@@ -173855,7 +173820,21 @@ var ts;
|
|
|
173855
173820
|
Session.prototype.getFileReferences = function (args, simplifiedResult) {
|
|
173856
173821
|
var _this = this;
|
|
173857
173822
|
var projects = this.getProjects(args);
|
|
173858
|
-
var
|
|
173823
|
+
var fileName = args.file;
|
|
173824
|
+
var references = [];
|
|
173825
|
+
forEachProjectInProjects(projects, /*path*/ undefined, function (project) {
|
|
173826
|
+
if (project.getCancellationToken().isCancellationRequested())
|
|
173827
|
+
return;
|
|
173828
|
+
var projectOutputs = project.getLanguageService().getFileReferences(fileName);
|
|
173829
|
+
if (projectOutputs) {
|
|
173830
|
+
for (var _i = 0, projectOutputs_3 = projectOutputs; _i < projectOutputs_3.length; _i++) {
|
|
173831
|
+
var referenceEntry = projectOutputs_3[_i];
|
|
173832
|
+
if (!ts.contains(references, referenceEntry, ts.documentSpansEqual)) {
|
|
173833
|
+
references.push(referenceEntry);
|
|
173834
|
+
}
|
|
173835
|
+
}
|
|
173836
|
+
}
|
|
173837
|
+
});
|
|
173859
173838
|
if (!simplifiedResult)
|
|
173860
173839
|
return references;
|
|
173861
173840
|
var refs = references.map(function (entry) { return referenceEntryToReferencesResponseItem(_this.projectService, entry); });
|
|
@@ -174254,10 +174233,13 @@ var ts;
|
|
|
174254
174233
|
Session.prototype.getNavigateToItems = function (args, simplifiedResult) {
|
|
174255
174234
|
var full = this.getFullNavigateToItems(args);
|
|
174256
174235
|
return !simplifiedResult ?
|
|
174257
|
-
flattenCombineOutputResult(full) :
|
|
174258
174236
|
ts.flatMap(full, function (_a) {
|
|
174259
|
-
var
|
|
174260
|
-
return
|
|
174237
|
+
var navigateToItems = _a.navigateToItems;
|
|
174238
|
+
return navigateToItems;
|
|
174239
|
+
}) :
|
|
174240
|
+
ts.flatMap(full, function (_a) {
|
|
174241
|
+
var project = _a.project, navigateToItems = _a.navigateToItems;
|
|
174242
|
+
return navigateToItems.map(function (navItem) {
|
|
174261
174243
|
var scriptInfo = project.getScriptInfo(navItem.fileName);
|
|
174262
174244
|
var bakedItem = {
|
|
174263
174245
|
name: navItem.name,
|
|
@@ -174287,13 +174269,57 @@ var ts;
|
|
|
174287
174269
|
if (currentFileOnly) {
|
|
174288
174270
|
ts.Debug.assertIsDefined(args.file);
|
|
174289
174271
|
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
174290
|
-
return [{ project: project,
|
|
174272
|
+
return [{ project: project, navigateToItems: project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, file) }];
|
|
174273
|
+
}
|
|
174274
|
+
var outputs = [];
|
|
174275
|
+
// This is effectively a hashset with `name` as the custom hash and `navigateToItemIsEqualTo` as the custom equals.
|
|
174276
|
+
// `name` is a very cheap hash function, but we could incorporate other properties to reduce collisions.
|
|
174277
|
+
var seenItems = new ts.Map(); // name to items with that name
|
|
174278
|
+
if (!args.file && !projectFileName) {
|
|
174279
|
+
// VS Code's `Go to symbol in workspaces` sends request like this
|
|
174280
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174281
|
+
// This appears to have been intended to search all projects but, in practice, it seems to only search
|
|
174282
|
+
// those that are downstream from already-loaded projects.
|
|
174283
|
+
// Filtering by !isSourceOfProjectReferenceRedirect is new, but seems appropriate and consistent with
|
|
174284
|
+
// the case below.
|
|
174285
|
+
this.projectService.loadAncestorProjectTree();
|
|
174286
|
+
this.projectService.forEachEnabledProject(function (project) { return addItemsForProject(project); });
|
|
174291
174287
|
}
|
|
174292
|
-
else
|
|
174293
|
-
|
|
174288
|
+
else {
|
|
174289
|
+
// VS's `Go to symbol` sends requests with just a project and doesn't want cascading since it will
|
|
174290
|
+
// send a separate request for each project of interest
|
|
174291
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174292
|
+
// This doesn't really make sense unless it's a single project matching `projectFileName`
|
|
174293
|
+
var projects = this.getProjects(args);
|
|
174294
|
+
forEachProjectInProjects(projects, /*path*/ undefined, function (project) { return addItemsForProject(project); });
|
|
174295
|
+
}
|
|
174296
|
+
return outputs;
|
|
174297
|
+
// Mutates `outputs`
|
|
174298
|
+
function addItemsForProject(project) {
|
|
174299
|
+
var projectItems = project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*filename*/ undefined, /*excludeDts*/ project.isNonTsProject());
|
|
174300
|
+
var unseenItems = ts.filter(projectItems, function (item) { return tryAddSeenItem(item) && !getMappedLocation(documentSpanLocation(item), project); });
|
|
174301
|
+
if (unseenItems.length) {
|
|
174302
|
+
outputs.push({ project: project, navigateToItems: unseenItems });
|
|
174303
|
+
}
|
|
174304
|
+
}
|
|
174305
|
+
// Returns true if the item had not been seen before
|
|
174306
|
+
// Mutates `seenItems`
|
|
174307
|
+
function tryAddSeenItem(item) {
|
|
174308
|
+
var name = item.name;
|
|
174309
|
+
if (!seenItems.has(name)) {
|
|
174310
|
+
seenItems.set(name, [item]);
|
|
174311
|
+
return true;
|
|
174312
|
+
}
|
|
174313
|
+
var seen = seenItems.get(name);
|
|
174314
|
+
for (var _i = 0, seen_1 = seen; _i < seen_1.length; _i++) {
|
|
174315
|
+
var seenItem = seen_1[_i];
|
|
174316
|
+
if (navigateToItemIsEqualTo(seenItem, item)) {
|
|
174317
|
+
return false;
|
|
174318
|
+
}
|
|
174319
|
+
}
|
|
174320
|
+
seen.push(item);
|
|
174321
|
+
return true;
|
|
174294
174322
|
}
|
|
174295
|
-
var fileArgs = args;
|
|
174296
|
-
return combineProjectOutputWhileOpeningReferencedProjects(this.getProjects(fileArgs), this.getDefaultProject(fileArgs), function (project) { return project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*fileName*/ undefined, /*excludeDts*/ project.isNonTsProject()); }, documentSpanLocation, navigateToItemIsEqualTo);
|
|
174297
174323
|
function navigateToItemIsEqualTo(a, b) {
|
|
174298
174324
|
if (a === b) {
|
|
174299
174325
|
return true;
|
|
@@ -174385,8 +174411,28 @@ var ts;
|
|
|
174385
174411
|
var newPath = server.toNormalizedPath(args.newFilePath);
|
|
174386
174412
|
var formatOptions = this.getHostFormatOptions();
|
|
174387
174413
|
var preferences = this.getHostPreferences();
|
|
174388
|
-
var
|
|
174389
|
-
|
|
174414
|
+
var seenFiles = new ts.Set();
|
|
174415
|
+
var textChanges = [];
|
|
174416
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174417
|
+
// This appears to have been intended to search all projects but, in practice, it seems to only search
|
|
174418
|
+
// those that are downstream from already-loaded projects.
|
|
174419
|
+
this.projectService.loadAncestorProjectTree();
|
|
174420
|
+
this.projectService.forEachEnabledProject(function (project) {
|
|
174421
|
+
var projectTextChanges = project.getLanguageService().getEditsForFileRename(oldPath, newPath, formatOptions, preferences);
|
|
174422
|
+
var projectFiles = [];
|
|
174423
|
+
for (var _i = 0, projectTextChanges_1 = projectTextChanges; _i < projectTextChanges_1.length; _i++) {
|
|
174424
|
+
var textChange = projectTextChanges_1[_i];
|
|
174425
|
+
if (!seenFiles.has(textChange.fileName)) {
|
|
174426
|
+
textChanges.push(textChange);
|
|
174427
|
+
projectFiles.push(textChange.fileName);
|
|
174428
|
+
}
|
|
174429
|
+
}
|
|
174430
|
+
for (var _a = 0, projectFiles_1 = projectFiles; _a < projectFiles_1.length; _a++) {
|
|
174431
|
+
var file = projectFiles_1[_a];
|
|
174432
|
+
seenFiles.add(file);
|
|
174433
|
+
}
|
|
174434
|
+
});
|
|
174435
|
+
return simplifiedResult ? textChanges.map(function (c) { return _this.mapTextChangeToCodeEdit(c); }) : textChanges;
|
|
174390
174436
|
};
|
|
174391
174437
|
Session.prototype.getCodeFixes = function (args, simplifiedResult) {
|
|
174392
174438
|
var _this = this;
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220308";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -15027,7 +15027,7 @@ var ts;
|
|
|
15027
15027
|
return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
|
|
15028
15028
|
}
|
|
15029
15029
|
ts.isComputedNonLiteralName = isComputedNonLiteralName;
|
|
15030
|
-
function
|
|
15030
|
+
function tryGetTextOfPropertyName(name) {
|
|
15031
15031
|
switch (name.kind) {
|
|
15032
15032
|
case 79 /* Identifier */:
|
|
15033
15033
|
case 80 /* PrivateIdentifier */:
|
|
@@ -15039,11 +15039,15 @@ var ts;
|
|
|
15039
15039
|
case 161 /* ComputedPropertyName */:
|
|
15040
15040
|
if (isStringOrNumericLiteralLike(name.expression))
|
|
15041
15041
|
return ts.escapeLeadingUnderscores(name.expression.text);
|
|
15042
|
-
return
|
|
15042
|
+
return undefined;
|
|
15043
15043
|
default:
|
|
15044
15044
|
return ts.Debug.assertNever(name);
|
|
15045
15045
|
}
|
|
15046
15046
|
}
|
|
15047
|
+
ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
|
|
15048
|
+
function getTextOfPropertyName(name) {
|
|
15049
|
+
return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
|
|
15050
|
+
}
|
|
15047
15051
|
ts.getTextOfPropertyName = getTextOfPropertyName;
|
|
15048
15052
|
function entityNameToString(name) {
|
|
15049
15053
|
switch (name.kind) {
|
|
@@ -15595,7 +15599,7 @@ var ts;
|
|
|
15595
15599
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
15596
15600
|
return objectLiteral.properties.filter(function (property) {
|
|
15597
15601
|
if (property.kind === 295 /* PropertyAssignment */) {
|
|
15598
|
-
var propName =
|
|
15602
|
+
var propName = tryGetTextOfPropertyName(property.name);
|
|
15599
15603
|
return key === propName || (!!key2 && key2 === propName);
|
|
15600
15604
|
}
|
|
15601
15605
|
return false;
|
|
@@ -172619,47 +172623,18 @@ var ts;
|
|
|
172619
172623
|
}
|
|
172620
172624
|
return ts.deduplicate(outputs, ts.equateValues);
|
|
172621
172625
|
}
|
|
172622
|
-
|
|
172623
|
-
|
|
172624
|
-
|
|
172625
|
-
return ts.contains(result, output, areEqual);
|
|
172626
|
-
});
|
|
172627
|
-
}
|
|
172628
|
-
function addToCombineOutputResult(outputs, project, result) {
|
|
172629
|
-
if (result.length)
|
|
172630
|
-
outputs.push({ project: project, result: result });
|
|
172631
|
-
}
|
|
172632
|
-
function combineProjectOutputFromEveryProject(projectService, action, areEqual) {
|
|
172633
|
-
var outputs = [];
|
|
172634
|
-
projectService.loadAncestorProjectTree();
|
|
172635
|
-
projectService.forEachEnabledProject(function (project) {
|
|
172636
|
-
var theseOutputs = action(project);
|
|
172637
|
-
addToCombineOutputResult(outputs, project, ts.filter(theseOutputs, function (output) { return !combineOutputResultContains(outputs, output, areEqual); }));
|
|
172638
|
-
});
|
|
172639
|
-
return outputs;
|
|
172640
|
-
}
|
|
172641
|
-
function flattenCombineOutputResult(outputs) {
|
|
172642
|
-
return ts.flatMap(outputs, function (_a) {
|
|
172643
|
-
var result = _a.result;
|
|
172644
|
-
return result;
|
|
172645
|
-
});
|
|
172646
|
-
}
|
|
172647
|
-
function combineProjectOutputWhileOpeningReferencedProjects(projects, defaultProject, action, getLocation, resultsEqual) {
|
|
172648
|
-
var outputs = [];
|
|
172649
|
-
combineProjectOutputWorker(projects, defaultProject,
|
|
172650
|
-
/*initialLocation*/ undefined, function (project, _, tryAddToTodo) {
|
|
172651
|
-
var theseOutputs = action(project);
|
|
172652
|
-
addToCombineOutputResult(outputs, project, ts.filter(theseOutputs, function (output) { return !combineOutputResultContains(outputs, output, resultsEqual) && !tryAddToTodo(project, getLocation(output)); }));
|
|
172653
|
-
});
|
|
172654
|
-
return outputs;
|
|
172655
|
-
}
|
|
172656
|
-
function combineProjectOutputForRenameLocations(projects, defaultProject, initialLocation, findInStrings, findInComments, hostPreferences) {
|
|
172626
|
+
;
|
|
172627
|
+
function combineProjectOutputForRenameLocations(projects, defaultProject, initialLocation, findInStrings, findInComments, _a) {
|
|
172628
|
+
var providePrefixAndSuffixTextForRename = _a.providePrefixAndSuffixTextForRename;
|
|
172657
172629
|
var outputs = [];
|
|
172658
172630
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, tryAddToTodo) {
|
|
172659
|
-
|
|
172660
|
-
|
|
172661
|
-
|
|
172662
|
-
|
|
172631
|
+
var projectOutputs = project.getLanguageService().findRenameLocations(location.fileName, location.pos, findInStrings, findInComments, providePrefixAndSuffixTextForRename);
|
|
172632
|
+
if (projectOutputs) {
|
|
172633
|
+
for (var _i = 0, projectOutputs_1 = projectOutputs; _i < projectOutputs_1.length; _i++) {
|
|
172634
|
+
var output = projectOutputs_1[_i];
|
|
172635
|
+
if (!ts.contains(outputs, output, ts.documentSpansEqual) && !tryAddToTodo(project, documentSpanLocation(output))) {
|
|
172636
|
+
outputs.push(output);
|
|
172637
|
+
}
|
|
172663
172638
|
}
|
|
172664
172639
|
}
|
|
172665
172640
|
});
|
|
@@ -172674,43 +172649,33 @@ var ts;
|
|
|
172674
172649
|
var outputs = [];
|
|
172675
172650
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, getMappedLocation) {
|
|
172676
172651
|
logger.info("Finding references to " + location.fileName + " position " + location.pos + " in project " + project.getProjectName());
|
|
172677
|
-
var
|
|
172678
|
-
|
|
172679
|
-
var
|
|
172680
|
-
|
|
172681
|
-
|
|
172682
|
-
|
|
172683
|
-
symbolToAddTo = {
|
|
172684
|
-
|
|
172685
|
-
|
|
172686
|
-
|
|
172687
|
-
|
|
172688
|
-
|
|
172689
|
-
|
|
172690
|
-
|
|
172652
|
+
var projectOutputs = project.getLanguageService().findReferences(location.fileName, location.pos);
|
|
172653
|
+
if (projectOutputs) {
|
|
172654
|
+
var _loop_8 = function (referencedSymbol) {
|
|
172655
|
+
var mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(referencedSymbol.definition));
|
|
172656
|
+
var definition = mappedDefinitionFile === undefined ?
|
|
172657
|
+
referencedSymbol.definition : __assign(__assign({}, referencedSymbol.definition), { textSpan: ts.createTextSpan(mappedDefinitionFile.pos, referencedSymbol.definition.textSpan.length), fileName: mappedDefinitionFile.fileName, contextSpan: getMappedContextSpan(referencedSymbol.definition, project) });
|
|
172658
|
+
var symbolToAddTo = ts.find(outputs, function (o) { return ts.documentSpansEqual(o.definition, definition); });
|
|
172659
|
+
if (!symbolToAddTo) {
|
|
172660
|
+
symbolToAddTo = { definition: definition, references: [] };
|
|
172661
|
+
outputs.push(symbolToAddTo);
|
|
172662
|
+
}
|
|
172663
|
+
for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) {
|
|
172664
|
+
var ref = _b[_a];
|
|
172665
|
+
// If it's in a mapped file, that is added to the todo list by `getMappedLocation`.
|
|
172666
|
+
if (!ts.contains(symbolToAddTo.references, ref, ts.documentSpansEqual) && !getMappedLocation(project, documentSpanLocation(ref))) {
|
|
172667
|
+
symbolToAddTo.references.push(ref);
|
|
172668
|
+
}
|
|
172691
172669
|
}
|
|
172670
|
+
};
|
|
172671
|
+
for (var _i = 0, projectOutputs_2 = projectOutputs; _i < projectOutputs_2.length; _i++) {
|
|
172672
|
+
var referencedSymbol = projectOutputs_2[_i];
|
|
172673
|
+
_loop_8(referencedSymbol);
|
|
172692
172674
|
}
|
|
172693
|
-
};
|
|
172694
|
-
for (var _i = 0, _a = project.getLanguageService().findReferences(location.fileName, location.pos) || server.emptyArray; _i < _a.length; _i++) {
|
|
172695
|
-
var outputReferencedSymbol = _a[_i];
|
|
172696
|
-
_loop_8(outputReferencedSymbol);
|
|
172697
172675
|
}
|
|
172698
172676
|
});
|
|
172699
172677
|
return outputs.filter(function (o) { return o.references.length !== 0; });
|
|
172700
172678
|
}
|
|
172701
|
-
function combineProjectOutputForFileReferences(projects, defaultProject, fileName) {
|
|
172702
|
-
var outputs = [];
|
|
172703
|
-
combineProjectOutputWorker(projects, defaultProject,
|
|
172704
|
-
/*initialLocation*/ undefined, function (project) {
|
|
172705
|
-
for (var _i = 0, _a = project.getLanguageService().getFileReferences(fileName) || server.emptyArray; _i < _a.length; _i++) {
|
|
172706
|
-
var referenceEntry = _a[_i];
|
|
172707
|
-
if (!ts.contains(outputs, referenceEntry, ts.documentSpansEqual)) {
|
|
172708
|
-
outputs.push(referenceEntry);
|
|
172709
|
-
}
|
|
172710
|
-
}
|
|
172711
|
-
});
|
|
172712
|
-
return outputs;
|
|
172713
|
-
}
|
|
172714
172679
|
function forEachProjectInProjects(projects, path, cb) {
|
|
172715
172680
|
for (var _i = 0, _a = ts.isArray(projects) ? projects : projects.projects; _i < _a.length; _i++) {
|
|
172716
172681
|
var project = _a[_i];
|
|
@@ -174049,7 +174014,21 @@ var ts;
|
|
|
174049
174014
|
Session.prototype.getFileReferences = function (args, simplifiedResult) {
|
|
174050
174015
|
var _this = this;
|
|
174051
174016
|
var projects = this.getProjects(args);
|
|
174052
|
-
var
|
|
174017
|
+
var fileName = args.file;
|
|
174018
|
+
var references = [];
|
|
174019
|
+
forEachProjectInProjects(projects, /*path*/ undefined, function (project) {
|
|
174020
|
+
if (project.getCancellationToken().isCancellationRequested())
|
|
174021
|
+
return;
|
|
174022
|
+
var projectOutputs = project.getLanguageService().getFileReferences(fileName);
|
|
174023
|
+
if (projectOutputs) {
|
|
174024
|
+
for (var _i = 0, projectOutputs_3 = projectOutputs; _i < projectOutputs_3.length; _i++) {
|
|
174025
|
+
var referenceEntry = projectOutputs_3[_i];
|
|
174026
|
+
if (!ts.contains(references, referenceEntry, ts.documentSpansEqual)) {
|
|
174027
|
+
references.push(referenceEntry);
|
|
174028
|
+
}
|
|
174029
|
+
}
|
|
174030
|
+
}
|
|
174031
|
+
});
|
|
174053
174032
|
if (!simplifiedResult)
|
|
174054
174033
|
return references;
|
|
174055
174034
|
var refs = references.map(function (entry) { return referenceEntryToReferencesResponseItem(_this.projectService, entry); });
|
|
@@ -174448,10 +174427,13 @@ var ts;
|
|
|
174448
174427
|
Session.prototype.getNavigateToItems = function (args, simplifiedResult) {
|
|
174449
174428
|
var full = this.getFullNavigateToItems(args);
|
|
174450
174429
|
return !simplifiedResult ?
|
|
174451
|
-
flattenCombineOutputResult(full) :
|
|
174452
174430
|
ts.flatMap(full, function (_a) {
|
|
174453
|
-
var
|
|
174454
|
-
return
|
|
174431
|
+
var navigateToItems = _a.navigateToItems;
|
|
174432
|
+
return navigateToItems;
|
|
174433
|
+
}) :
|
|
174434
|
+
ts.flatMap(full, function (_a) {
|
|
174435
|
+
var project = _a.project, navigateToItems = _a.navigateToItems;
|
|
174436
|
+
return navigateToItems.map(function (navItem) {
|
|
174455
174437
|
var scriptInfo = project.getScriptInfo(navItem.fileName);
|
|
174456
174438
|
var bakedItem = {
|
|
174457
174439
|
name: navItem.name,
|
|
@@ -174481,13 +174463,57 @@ var ts;
|
|
|
174481
174463
|
if (currentFileOnly) {
|
|
174482
174464
|
ts.Debug.assertIsDefined(args.file);
|
|
174483
174465
|
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
174484
|
-
return [{ project: project,
|
|
174466
|
+
return [{ project: project, navigateToItems: project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, file) }];
|
|
174467
|
+
}
|
|
174468
|
+
var outputs = [];
|
|
174469
|
+
// This is effectively a hashset with `name` as the custom hash and `navigateToItemIsEqualTo` as the custom equals.
|
|
174470
|
+
// `name` is a very cheap hash function, but we could incorporate other properties to reduce collisions.
|
|
174471
|
+
var seenItems = new ts.Map(); // name to items with that name
|
|
174472
|
+
if (!args.file && !projectFileName) {
|
|
174473
|
+
// VS Code's `Go to symbol in workspaces` sends request like this
|
|
174474
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174475
|
+
// This appears to have been intended to search all projects but, in practice, it seems to only search
|
|
174476
|
+
// those that are downstream from already-loaded projects.
|
|
174477
|
+
// Filtering by !isSourceOfProjectReferenceRedirect is new, but seems appropriate and consistent with
|
|
174478
|
+
// the case below.
|
|
174479
|
+
this.projectService.loadAncestorProjectTree();
|
|
174480
|
+
this.projectService.forEachEnabledProject(function (project) { return addItemsForProject(project); });
|
|
174485
174481
|
}
|
|
174486
|
-
else
|
|
174487
|
-
|
|
174482
|
+
else {
|
|
174483
|
+
// VS's `Go to symbol` sends requests with just a project and doesn't want cascading since it will
|
|
174484
|
+
// send a separate request for each project of interest
|
|
174485
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174486
|
+
// This doesn't really make sense unless it's a single project matching `projectFileName`
|
|
174487
|
+
var projects = this.getProjects(args);
|
|
174488
|
+
forEachProjectInProjects(projects, /*path*/ undefined, function (project) { return addItemsForProject(project); });
|
|
174489
|
+
}
|
|
174490
|
+
return outputs;
|
|
174491
|
+
// Mutates `outputs`
|
|
174492
|
+
function addItemsForProject(project) {
|
|
174493
|
+
var projectItems = project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*filename*/ undefined, /*excludeDts*/ project.isNonTsProject());
|
|
174494
|
+
var unseenItems = ts.filter(projectItems, function (item) { return tryAddSeenItem(item) && !getMappedLocation(documentSpanLocation(item), project); });
|
|
174495
|
+
if (unseenItems.length) {
|
|
174496
|
+
outputs.push({ project: project, navigateToItems: unseenItems });
|
|
174497
|
+
}
|
|
174498
|
+
}
|
|
174499
|
+
// Returns true if the item had not been seen before
|
|
174500
|
+
// Mutates `seenItems`
|
|
174501
|
+
function tryAddSeenItem(item) {
|
|
174502
|
+
var name = item.name;
|
|
174503
|
+
if (!seenItems.has(name)) {
|
|
174504
|
+
seenItems.set(name, [item]);
|
|
174505
|
+
return true;
|
|
174506
|
+
}
|
|
174507
|
+
var seen = seenItems.get(name);
|
|
174508
|
+
for (var _i = 0, seen_1 = seen; _i < seen_1.length; _i++) {
|
|
174509
|
+
var seenItem = seen_1[_i];
|
|
174510
|
+
if (navigateToItemIsEqualTo(seenItem, item)) {
|
|
174511
|
+
return false;
|
|
174512
|
+
}
|
|
174513
|
+
}
|
|
174514
|
+
seen.push(item);
|
|
174515
|
+
return true;
|
|
174488
174516
|
}
|
|
174489
|
-
var fileArgs = args;
|
|
174490
|
-
return combineProjectOutputWhileOpeningReferencedProjects(this.getProjects(fileArgs), this.getDefaultProject(fileArgs), function (project) { return project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*fileName*/ undefined, /*excludeDts*/ project.isNonTsProject()); }, documentSpanLocation, navigateToItemIsEqualTo);
|
|
174491
174517
|
function navigateToItemIsEqualTo(a, b) {
|
|
174492
174518
|
if (a === b) {
|
|
174493
174519
|
return true;
|
|
@@ -174579,8 +174605,28 @@ var ts;
|
|
|
174579
174605
|
var newPath = server.toNormalizedPath(args.newFilePath);
|
|
174580
174606
|
var formatOptions = this.getHostFormatOptions();
|
|
174581
174607
|
var preferences = this.getHostPreferences();
|
|
174582
|
-
var
|
|
174583
|
-
|
|
174608
|
+
var seenFiles = new ts.Set();
|
|
174609
|
+
var textChanges = [];
|
|
174610
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174611
|
+
// This appears to have been intended to search all projects but, in practice, it seems to only search
|
|
174612
|
+
// those that are downstream from already-loaded projects.
|
|
174613
|
+
this.projectService.loadAncestorProjectTree();
|
|
174614
|
+
this.projectService.forEachEnabledProject(function (project) {
|
|
174615
|
+
var projectTextChanges = project.getLanguageService().getEditsForFileRename(oldPath, newPath, formatOptions, preferences);
|
|
174616
|
+
var projectFiles = [];
|
|
174617
|
+
for (var _i = 0, projectTextChanges_1 = projectTextChanges; _i < projectTextChanges_1.length; _i++) {
|
|
174618
|
+
var textChange = projectTextChanges_1[_i];
|
|
174619
|
+
if (!seenFiles.has(textChange.fileName)) {
|
|
174620
|
+
textChanges.push(textChange);
|
|
174621
|
+
projectFiles.push(textChange.fileName);
|
|
174622
|
+
}
|
|
174623
|
+
}
|
|
174624
|
+
for (var _a = 0, projectFiles_1 = projectFiles; _a < projectFiles_1.length; _a++) {
|
|
174625
|
+
var file = projectFiles_1[_a];
|
|
174626
|
+
seenFiles.add(file);
|
|
174627
|
+
}
|
|
174628
|
+
});
|
|
174629
|
+
return simplifiedResult ? textChanges.map(function (c) { return _this.mapTextChangeToCodeEdit(c); }) : textChanges;
|
|
174584
174630
|
};
|
|
174585
174631
|
Session.prototype.getCodeFixes = function (args, simplifiedResult) {
|
|
174586
174632
|
var _this = this;
|
package/lib/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220308";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -15027,7 +15027,7 @@ var ts;
|
|
|
15027
15027
|
return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
|
|
15028
15028
|
}
|
|
15029
15029
|
ts.isComputedNonLiteralName = isComputedNonLiteralName;
|
|
15030
|
-
function
|
|
15030
|
+
function tryGetTextOfPropertyName(name) {
|
|
15031
15031
|
switch (name.kind) {
|
|
15032
15032
|
case 79 /* Identifier */:
|
|
15033
15033
|
case 80 /* PrivateIdentifier */:
|
|
@@ -15039,11 +15039,15 @@ var ts;
|
|
|
15039
15039
|
case 161 /* ComputedPropertyName */:
|
|
15040
15040
|
if (isStringOrNumericLiteralLike(name.expression))
|
|
15041
15041
|
return ts.escapeLeadingUnderscores(name.expression.text);
|
|
15042
|
-
return
|
|
15042
|
+
return undefined;
|
|
15043
15043
|
default:
|
|
15044
15044
|
return ts.Debug.assertNever(name);
|
|
15045
15045
|
}
|
|
15046
15046
|
}
|
|
15047
|
+
ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
|
|
15048
|
+
function getTextOfPropertyName(name) {
|
|
15049
|
+
return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
|
|
15050
|
+
}
|
|
15047
15051
|
ts.getTextOfPropertyName = getTextOfPropertyName;
|
|
15048
15052
|
function entityNameToString(name) {
|
|
15049
15053
|
switch (name.kind) {
|
|
@@ -15595,7 +15599,7 @@ var ts;
|
|
|
15595
15599
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
15596
15600
|
return objectLiteral.properties.filter(function (property) {
|
|
15597
15601
|
if (property.kind === 295 /* PropertyAssignment */) {
|
|
15598
|
-
var propName =
|
|
15602
|
+
var propName = tryGetTextOfPropertyName(property.name);
|
|
15599
15603
|
return key === propName || (!!key2 && key2 === propName);
|
|
15600
15604
|
}
|
|
15601
15605
|
return false;
|
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220308";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -15027,7 +15027,7 @@ var ts;
|
|
|
15027
15027
|
return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
|
|
15028
15028
|
}
|
|
15029
15029
|
ts.isComputedNonLiteralName = isComputedNonLiteralName;
|
|
15030
|
-
function
|
|
15030
|
+
function tryGetTextOfPropertyName(name) {
|
|
15031
15031
|
switch (name.kind) {
|
|
15032
15032
|
case 79 /* Identifier */:
|
|
15033
15033
|
case 80 /* PrivateIdentifier */:
|
|
@@ -15039,11 +15039,15 @@ var ts;
|
|
|
15039
15039
|
case 161 /* ComputedPropertyName */:
|
|
15040
15040
|
if (isStringOrNumericLiteralLike(name.expression))
|
|
15041
15041
|
return ts.escapeLeadingUnderscores(name.expression.text);
|
|
15042
|
-
return
|
|
15042
|
+
return undefined;
|
|
15043
15043
|
default:
|
|
15044
15044
|
return ts.Debug.assertNever(name);
|
|
15045
15045
|
}
|
|
15046
15046
|
}
|
|
15047
|
+
ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
|
|
15048
|
+
function getTextOfPropertyName(name) {
|
|
15049
|
+
return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
|
|
15050
|
+
}
|
|
15047
15051
|
ts.getTextOfPropertyName = getTextOfPropertyName;
|
|
15048
15052
|
function entityNameToString(name) {
|
|
15049
15053
|
switch (name.kind) {
|
|
@@ -15595,7 +15599,7 @@ var ts;
|
|
|
15595
15599
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
15596
15600
|
return objectLiteral.properties.filter(function (property) {
|
|
15597
15601
|
if (property.kind === 295 /* PropertyAssignment */) {
|
|
15598
|
-
var propName =
|
|
15602
|
+
var propName = tryGetTextOfPropertyName(property.name);
|
|
15599
15603
|
return key === propName || (!!key2 && key2 === propName);
|
|
15600
15604
|
}
|
|
15601
15605
|
return false;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220308";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -14822,7 +14822,7 @@ var ts;
|
|
|
14822
14822
|
return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
|
|
14823
14823
|
}
|
|
14824
14824
|
ts.isComputedNonLiteralName = isComputedNonLiteralName;
|
|
14825
|
-
function
|
|
14825
|
+
function tryGetTextOfPropertyName(name) {
|
|
14826
14826
|
switch (name.kind) {
|
|
14827
14827
|
case 79 /* Identifier */:
|
|
14828
14828
|
case 80 /* PrivateIdentifier */:
|
|
@@ -14834,11 +14834,15 @@ var ts;
|
|
|
14834
14834
|
case 161 /* ComputedPropertyName */:
|
|
14835
14835
|
if (isStringOrNumericLiteralLike(name.expression))
|
|
14836
14836
|
return ts.escapeLeadingUnderscores(name.expression.text);
|
|
14837
|
-
return
|
|
14837
|
+
return undefined;
|
|
14838
14838
|
default:
|
|
14839
14839
|
return ts.Debug.assertNever(name);
|
|
14840
14840
|
}
|
|
14841
14841
|
}
|
|
14842
|
+
ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
|
|
14843
|
+
function getTextOfPropertyName(name) {
|
|
14844
|
+
return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
|
|
14845
|
+
}
|
|
14842
14846
|
ts.getTextOfPropertyName = getTextOfPropertyName;
|
|
14843
14847
|
function entityNameToString(name) {
|
|
14844
14848
|
switch (name.kind) {
|
|
@@ -15390,7 +15394,7 @@ var ts;
|
|
|
15390
15394
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
15391
15395
|
return objectLiteral.properties.filter(function (property) {
|
|
15392
15396
|
if (property.kind === 295 /* PropertyAssignment */) {
|
|
15393
|
-
var propName =
|
|
15397
|
+
var propName = tryGetTextOfPropertyName(property.name);
|
|
15394
15398
|
return key === propName || (!!key2 && key2 === propName);
|
|
15395
15399
|
}
|
|
15396
15400
|
return false;
|
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": "4.7.0-dev.
|
|
5
|
+
"version": "4.7.0-dev.20220308",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|