Skip to content

Commit 34f0e32

Browse files
Bump version to 4.2.3 and LKG
1 parent 47b2632 commit 34f0e32

10 files changed

+300
-78
lines changed

lib/protocol.d.ts

+63
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,41 @@ declare namespace ts.server.protocol {
603603
*/
604604
body?: string[];
605605
}
606+
/**
607+
* A request to get encoded semantic classifications for a span in the file
608+
*/
609+
interface EncodedSemanticClassificationsRequest extends FileRequest {
610+
arguments: EncodedSemanticClassificationsRequestArgs;
611+
}
612+
/**
613+
* Arguments for EncodedSemanticClassificationsRequest request.
614+
*/
615+
interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
616+
/**
617+
* Start position of the span.
618+
*/
619+
start: number;
620+
/**
621+
* Length of the span.
622+
*/
623+
length: number;
624+
/**
625+
* Optional parameter for the semantic highlighting response, if absent it
626+
* defaults to "original".
627+
*/
628+
format?: "original" | "2020";
629+
}
630+
/** The response for a EncodedSemanticClassificationsRequest */
631+
interface EncodedSemanticClassificationsResponse extends Response {
632+
body?: EncodedSemanticClassificationsResponseBody;
633+
}
634+
/**
635+
* Implementation response message. Gives series of text spans depending on the format ar.
636+
*/
637+
interface EncodedSemanticClassificationsResponseBody {
638+
endOfLineState: EndOfLineState;
639+
spans: number[];
640+
}
606641
/**
607642
* Arguments in document highlight request; include: filesToSearch, file,
608643
* line, offset.
@@ -2626,6 +2661,33 @@ declare namespace ts.server.protocol {
26262661
ES2020 = "ES2020",
26272662
ESNext = "ESNext"
26282663
}
2664+
const enum ClassificationType {
2665+
comment = 1,
2666+
identifier = 2,
2667+
keyword = 3,
2668+
numericLiteral = 4,
2669+
operator = 5,
2670+
stringLiteral = 6,
2671+
regularExpressionLiteral = 7,
2672+
whiteSpace = 8,
2673+
text = 9,
2674+
punctuation = 10,
2675+
className = 11,
2676+
enumName = 12,
2677+
interfaceName = 13,
2678+
moduleName = 14,
2679+
typeParameterName = 15,
2680+
typeAliasName = 16,
2681+
parameterName = 17,
2682+
docCommentTagName = 18,
2683+
jsxOpenTagName = 19,
2684+
jsxCloseTagName = 20,
2685+
jsxSelfClosingTagName = 21,
2686+
jsxAttribute = 22,
2687+
jsxText = 23,
2688+
jsxAttributeStringLiteralValue = 24,
2689+
bigintLiteral = 25
2690+
}
26292691
}
26302692
declare namespace ts.server.protocol {
26312693

@@ -2786,6 +2848,7 @@ declare namespace ts.server.protocol {
27862848
}
27872849
declare namespace ts {
27882850
// these types are empty stubs for types from services and should not be used directly
2851+
export type EndOfLineState = never;
27892852
export type ScriptKind = never;
27902853
export type WatchFileKind = never;
27912854
export type WatchDirectoryKind = never;

lib/tsc.js

+18-12
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
6565
var ts;
6666
(function (ts) {
6767
ts.versionMajorMinor = "4.2";
68-
ts.version = "4.2.2";
68+
ts.version = "4.2.3";
6969
var NativeCollections;
7070
(function (NativeCollections) {
7171
function tryGetNativeMap() {
@@ -38531,13 +38531,16 @@ var ts;
3853138531
return result || ts.emptyArray;
3853238532
}
3853338533
function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
38534-
type.members = members;
38535-
type.properties = members === emptySymbols ? ts.emptyArray : getNamedMembers(members);
38536-
type.callSignatures = callSignatures;
38537-
type.constructSignatures = constructSignatures;
38538-
type.stringIndexInfo = stringIndexInfo;
38539-
type.numberIndexInfo = numberIndexInfo;
38540-
return type;
38534+
var resolved = type;
38535+
resolved.members = members;
38536+
resolved.properties = ts.emptyArray;
38537+
resolved.callSignatures = callSignatures;
38538+
resolved.constructSignatures = constructSignatures;
38539+
resolved.stringIndexInfo = stringIndexInfo;
38540+
resolved.numberIndexInfo = numberIndexInfo;
38541+
if (members !== emptySymbols)
38542+
resolved.properties = getNamedMembers(members);
38543+
return resolved;
3854138544
}
3854238545
function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
3854338546
return setStructuredTypeMembers(createObjectType(16, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
@@ -46092,7 +46095,7 @@ var ts;
4609246095
if (t.flags & 1048576) {
4609346096
var origin = t.origin;
4609446097
if (t.aliasSymbol || origin && !(origin.flags & 1048576)) {
46095-
namedUnions.push(t);
46098+
ts.pushIfUnique(namedUnions, t);
4609646099
}
4609746100
else if (origin && origin.flags & 1048576) {
4609846101
addNamedUnions(namedUnions, origin.types);
@@ -64692,6 +64695,7 @@ var ts;
6469264695
return true;
6469364696
}
6469464697
function checkAliasSymbol(node) {
64698+
var _a;
6469564699
var symbol = getSymbolOfNode(node);
6469664700
var target = resolveAlias(symbol);
6469764701
if (target !== unknownSymbol) {
@@ -64712,7 +64716,7 @@ var ts;
6471264716
&& !(node.flags & 8388608)) {
6471364717
error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
6471464718
}
64715-
if (ts.isImportSpecifier(node) && ts.every(target.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728); })) {
64719+
if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728); }))) {
6471664720
addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
6471764721
}
6471864722
}
@@ -91669,8 +91673,9 @@ var ts;
9166991673
var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
9167091674
var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
9167191675
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
91676+
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
9167291677
if (!preferSymlinks) {
91673-
var result_15 = ts.forEach(targets, function (p) { return !ts.containsIgnoredPath(p) && cb(p, referenceRedirect === p); });
91678+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
9167491679
if (result_15)
9167591680
return result_15;
9167691681
}
@@ -91695,13 +91700,14 @@ var ts;
9169591700
var symlinkDirectory = symlinkDirectories_1[_i];
9169691701
var option = ts.resolvePath(symlinkDirectory, relative);
9169791702
var result_16 = cb(option, target === referenceRedirect);
91703+
shouldFilterIgnoredPaths = true;
9169891704
if (result_16)
9169991705
return result_16;
9170091706
}
9170191707
});
9170291708
});
9170391709
return result || (preferSymlinks
91704-
? ts.forEach(targets, function (p) { return ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
91710+
? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
9170591711
: undefined);
9170691712
}
9170791713
moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;

lib/tsserver.js

+48-13
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ var ts;
9696
// The following is baselined as a literal template type without intervention
9797
/** The version of the TypeScript compiler release */
9898
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
99-
ts.version = "4.2.2";
99+
ts.version = "4.2.3";
100100
/* @internal */
101101
var Comparison;
102102
(function (Comparison) {
@@ -47044,13 +47044,17 @@ var ts;
4704447044
return result || ts.emptyArray;
4704547045
}
4704647046
function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
47047-
type.members = members;
47048-
type.properties = members === emptySymbols ? ts.emptyArray : getNamedMembers(members);
47049-
type.callSignatures = callSignatures;
47050-
type.constructSignatures = constructSignatures;
47051-
type.stringIndexInfo = stringIndexInfo;
47052-
type.numberIndexInfo = numberIndexInfo;
47053-
return type;
47047+
var resolved = type;
47048+
resolved.members = members;
47049+
resolved.properties = ts.emptyArray;
47050+
resolved.callSignatures = callSignatures;
47051+
resolved.constructSignatures = constructSignatures;
47052+
resolved.stringIndexInfo = stringIndexInfo;
47053+
resolved.numberIndexInfo = numberIndexInfo;
47054+
// This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized.
47055+
if (members !== emptySymbols)
47056+
resolved.properties = getNamedMembers(members);
47057+
return resolved;
4705447058
}
4705547059
function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
4705647060
return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
@@ -55719,7 +55723,7 @@ var ts;
5571955723
if (t.flags & 1048576 /* Union */) {
5572055724
var origin = t.origin;
5572155725
if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) {
55722-
namedUnions.push(t);
55726+
ts.pushIfUnique(namedUnions, t);
5572355727
}
5572455728
else if (origin && origin.flags & 1048576 /* Union */) {
5572555729
addNamedUnions(namedUnions, origin.types);
@@ -77354,6 +77358,7 @@ var ts;
7735477358
return true;
7735577359
}
7735677360
function checkAliasSymbol(node) {
77361+
var _a;
7735777362
var symbol = getSymbolOfNode(node);
7735877363
var target = resolveAlias(symbol);
7735977364
if (target !== unknownSymbol) {
@@ -77381,7 +77386,7 @@ var ts;
7738177386
&& !(node.flags & 8388608 /* Ambient */)) {
7738277387
error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
7738377388
}
77384-
if (ts.isImportSpecifier(node) && ts.every(target.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); })) {
77389+
if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
7738577390
addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
7738677391
}
7738777392
}
@@ -111486,10 +111491,11 @@ var ts;
111486111491
var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
111487111492
var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
111488111493
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
111494+
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
111489111495
if (!preferSymlinks) {
111490111496
// Symlinks inside ignored paths are already filtered out of the symlink cache,
111491111497
// so we only need to remove them from the realpath filenames.
111492-
var result_15 = ts.forEach(targets, function (p) { return !ts.containsIgnoredPath(p) && cb(p, referenceRedirect === p); });
111498+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
111493111499
if (result_15)
111494111500
return result_15;
111495111501
}
@@ -111515,13 +111521,14 @@ var ts;
111515111521
var symlinkDirectory = symlinkDirectories_1[_i];
111516111522
var option = ts.resolvePath(symlinkDirectory, relative);
111517111523
var result_16 = cb(option, target === referenceRedirect);
111524+
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
111518111525
if (result_16)
111519111526
return result_16;
111520111527
}
111521111528
});
111522111529
});
111523111530
return result || (preferSymlinks
111524-
? ts.forEach(targets, function (p) { return ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
111531+
? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
111525111532
: undefined);
111526111533
}
111527111534
moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;
@@ -139596,7 +139603,7 @@ var ts;
139596139603
}
139597139604
function addFunctionDeclaration(changes, context, info) {
139598139605
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
139599-
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, info.token, info.modifierFlags, info.parentDeclaration);
139606+
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, ts.idText(info.token), info.modifierFlags, info.parentDeclaration);
139600139607
changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration);
139601139608
}
139602139609
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -152538,6 +152545,34 @@ var ts;
152538152545
ScriptTarget["ES2020"] = "ES2020";
152539152546
ScriptTarget["ESNext"] = "ESNext";
152540152547
})(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {}));
152548+
var ClassificationType;
152549+
(function (ClassificationType) {
152550+
ClassificationType[ClassificationType["comment"] = 1] = "comment";
152551+
ClassificationType[ClassificationType["identifier"] = 2] = "identifier";
152552+
ClassificationType[ClassificationType["keyword"] = 3] = "keyword";
152553+
ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral";
152554+
ClassificationType[ClassificationType["operator"] = 5] = "operator";
152555+
ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral";
152556+
ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral";
152557+
ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace";
152558+
ClassificationType[ClassificationType["text"] = 9] = "text";
152559+
ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation";
152560+
ClassificationType[ClassificationType["className"] = 11] = "className";
152561+
ClassificationType[ClassificationType["enumName"] = 12] = "enumName";
152562+
ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName";
152563+
ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName";
152564+
ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName";
152565+
ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName";
152566+
ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName";
152567+
ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName";
152568+
ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName";
152569+
ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName";
152570+
ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName";
152571+
ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute";
152572+
ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText";
152573+
ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue";
152574+
ClassificationType[ClassificationType["bigintLiteral"] = 25] = "bigintLiteral";
152575+
})(ClassificationType = protocol.ClassificationType || (protocol.ClassificationType = {}));
152541152576
})(protocol = server.protocol || (server.protocol = {}));
152542152577
})(server = ts.server || (ts.server = {}));
152543152578
})(ts || (ts = {}));

lib/tsserverlibrary.d.ts

+62
Original file line numberDiff line numberDiff line change
@@ -7136,6 +7136,41 @@ declare namespace ts.server.protocol {
71367136
*/
71377137
body?: string[];
71387138
}
7139+
/**
7140+
* A request to get encoded semantic classifications for a span in the file
7141+
*/
7142+
interface EncodedSemanticClassificationsRequest extends FileRequest {
7143+
arguments: EncodedSemanticClassificationsRequestArgs;
7144+
}
7145+
/**
7146+
* Arguments for EncodedSemanticClassificationsRequest request.
7147+
*/
7148+
interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
7149+
/**
7150+
* Start position of the span.
7151+
*/
7152+
start: number;
7153+
/**
7154+
* Length of the span.
7155+
*/
7156+
length: number;
7157+
/**
7158+
* Optional parameter for the semantic highlighting response, if absent it
7159+
* defaults to "original".
7160+
*/
7161+
format?: "original" | "2020";
7162+
}
7163+
/** The response for a EncodedSemanticClassificationsRequest */
7164+
interface EncodedSemanticClassificationsResponse extends Response {
7165+
body?: EncodedSemanticClassificationsResponseBody;
7166+
}
7167+
/**
7168+
* Implementation response message. Gives series of text spans depending on the format ar.
7169+
*/
7170+
interface EncodedSemanticClassificationsResponseBody {
7171+
endOfLineState: EndOfLineState;
7172+
spans: number[];
7173+
}
71397174
/**
71407175
* Arguments in document highlight request; include: filesToSearch, file,
71417176
* line, offset.
@@ -9159,6 +9194,33 @@ declare namespace ts.server.protocol {
91599194
ES2020 = "ES2020",
91609195
ESNext = "ESNext"
91619196
}
9197+
enum ClassificationType {
9198+
comment = 1,
9199+
identifier = 2,
9200+
keyword = 3,
9201+
numericLiteral = 4,
9202+
operator = 5,
9203+
stringLiteral = 6,
9204+
regularExpressionLiteral = 7,
9205+
whiteSpace = 8,
9206+
text = 9,
9207+
punctuation = 10,
9208+
className = 11,
9209+
enumName = 12,
9210+
interfaceName = 13,
9211+
moduleName = 14,
9212+
typeParameterName = 15,
9213+
typeAliasName = 16,
9214+
parameterName = 17,
9215+
docCommentTagName = 18,
9216+
jsxOpenTagName = 19,
9217+
jsxCloseTagName = 20,
9218+
jsxSelfClosingTagName = 21,
9219+
jsxAttribute = 22,
9220+
jsxText = 23,
9221+
jsxAttributeStringLiteralValue = 24,
9222+
bigintLiteral = 25
9223+
}
91629224
}
91639225
declare namespace ts.server {
91649226
interface ScriptInfoVersion {

0 commit comments

Comments
 (0)