typescript 5.2.0-dev.20230728 → 5.2.0-dev.20230730
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/lib.es2015.core.d.ts +2 -2
- package/lib/lib.es2020.bigint.d.ts +4 -4
- package/lib/lib.es5.d.ts +18 -18
- package/lib/tsc.js +48 -41
- package/lib/tsserver.js +81 -58
- package/lib/tsserverlibrary.js +79 -58
- package/lib/typescript.js +74 -55
- package/lib/typingsInstaller.js +5 -5
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -751,6 +751,7 @@ __export(server_exports, {
|
|
|
751
751
|
getEmitModuleKind: () => getEmitModuleKind,
|
|
752
752
|
getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
|
|
753
753
|
getEmitScriptTarget: () => getEmitScriptTarget,
|
|
754
|
+
getEmitStandardClassFields: () => getEmitStandardClassFields,
|
|
754
755
|
getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer,
|
|
755
756
|
getEnclosingContainer: () => getEnclosingContainer,
|
|
756
757
|
getEncodedSemanticClassifications: () => getEncodedSemanticClassifications,
|
|
@@ -1426,6 +1427,7 @@ __export(server_exports, {
|
|
|
1426
1427
|
isInString: () => isInString,
|
|
1427
1428
|
isInTemplateString: () => isInTemplateString,
|
|
1428
1429
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
1430
|
+
isInTypeQuery: () => isInTypeQuery,
|
|
1429
1431
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
1430
1432
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
1431
1433
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|
|
@@ -2329,7 +2331,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2329
2331
|
|
|
2330
2332
|
// src/compiler/corePublic.ts
|
|
2331
2333
|
var versionMajorMinor = "5.2";
|
|
2332
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2334
|
+
var version = `${versionMajorMinor}.0-dev.20230730`;
|
|
2333
2335
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2334
2336
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2335
2337
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3498,7 +3500,7 @@ function identity(x) {
|
|
|
3498
3500
|
function toLowerCase(x) {
|
|
3499
3501
|
return x.toLowerCase();
|
|
3500
3502
|
}
|
|
3501
|
-
var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_
|
|
3503
|
+
var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
|
|
3502
3504
|
function toFileNameLowerCase(x) {
|
|
3503
3505
|
return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x;
|
|
3504
3506
|
}
|
|
@@ -4233,7 +4235,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
4233
4235
|
return func.name;
|
|
4234
4236
|
} else {
|
|
4235
4237
|
const text = Function.prototype.toString.call(func);
|
|
4236
|
-
const match = /^function\s+([\w
|
|
4238
|
+
const match = /^function\s+([\w$]+)\s*\(/.exec(text);
|
|
4237
4239
|
return match ? match[1] : "";
|
|
4238
4240
|
}
|
|
4239
4241
|
}
|
|
@@ -5016,7 +5018,7 @@ ${lanes.join("\n")}
|
|
|
5016
5018
|
})(Debug || (Debug = {}));
|
|
5017
5019
|
|
|
5018
5020
|
// src/compiler/semver.ts
|
|
5019
|
-
var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(
|
|
5021
|
+
var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
|
|
5020
5022
|
var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
|
|
5021
5023
|
var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
|
|
5022
5024
|
var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
|
|
@@ -13734,7 +13736,7 @@ function getNodeFlags(node) {
|
|
|
13734
13736
|
var supportedLocaleDirectories = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"];
|
|
13735
13737
|
function validateLocaleAndSetLanguage(locale, sys2, errors) {
|
|
13736
13738
|
const lowerCaseLocale = locale.toLowerCase();
|
|
13737
|
-
const matchResult = /^([a-z]+)([_
|
|
13739
|
+
const matchResult = /^([a-z]+)([_-]([a-z]+))?$/.exec(lowerCaseLocale);
|
|
13738
13740
|
if (!matchResult) {
|
|
13739
13741
|
if (errors) {
|
|
13740
13742
|
errors.push(createCompilerDiagnostic(Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp"));
|
|
@@ -18615,9 +18617,9 @@ function escapeTemplateSubstitution(str) {
|
|
|
18615
18617
|
function hasInvalidEscape(template) {
|
|
18616
18618
|
return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags));
|
|
18617
18619
|
}
|
|
18618
|
-
var doubleQuoteEscapedCharsRegExp = /[
|
|
18619
|
-
var singleQuoteEscapedCharsRegExp = /[
|
|
18620
|
-
var backtickQuoteEscapedCharsRegExp = /\r\n|[
|
|
18620
|
+
var doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
18621
|
+
var singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
18622
|
+
var backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
|
|
18621
18623
|
var escapedCharsMap = new Map(Object.entries({
|
|
18622
18624
|
" ": "\\t",
|
|
18623
18625
|
"\v": "\\v",
|
|
@@ -18662,8 +18664,8 @@ function escapeNonAsciiString(s, quoteChar) {
|
|
|
18662
18664
|
s = escapeString(s, quoteChar);
|
|
18663
18665
|
return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, (c) => encodeUtf16EscapeSequence(c.charCodeAt(0))) : s;
|
|
18664
18666
|
}
|
|
18665
|
-
var jsxDoubleQuoteEscapedCharsRegExp = /[
|
|
18666
|
-
var jsxSingleQuoteEscapedCharsRegExp = /[
|
|
18667
|
+
var jsxDoubleQuoteEscapedCharsRegExp = /["\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
18668
|
+
var jsxSingleQuoteEscapedCharsRegExp = /['\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
18667
18669
|
var jsxEscapedCharsMap = new Map(Object.entries({
|
|
18668
18670
|
'"': """,
|
|
18669
18671
|
"'": "'"
|
|
@@ -19039,6 +19041,12 @@ function parameterIsThisKeyword(parameter) {
|
|
|
19039
19041
|
function isThisIdentifier(node) {
|
|
19040
19042
|
return !!node && node.kind === 80 /* Identifier */ && identifierIsThisKeyword(node);
|
|
19041
19043
|
}
|
|
19044
|
+
function isInTypeQuery(node) {
|
|
19045
|
+
return !!findAncestor(
|
|
19046
|
+
node,
|
|
19047
|
+
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
19048
|
+
);
|
|
19049
|
+
}
|
|
19042
19050
|
function isThisInTypeQuery(node) {
|
|
19043
19051
|
if (!isThisIdentifier(node)) {
|
|
19044
19052
|
return false;
|
|
@@ -20536,6 +20544,9 @@ function getAllowJSCompilerOption(compilerOptions) {
|
|
|
20536
20544
|
function getUseDefineForClassFields(compilerOptions) {
|
|
20537
20545
|
return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
20538
20546
|
}
|
|
20547
|
+
function getEmitStandardClassFields(compilerOptions) {
|
|
20548
|
+
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
20549
|
+
}
|
|
20539
20550
|
function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
|
|
20540
20551
|
return optionsHaveChanges(oldOptions, newOptions, semanticDiagnosticsOptionDeclarations);
|
|
20541
20552
|
}
|
|
@@ -20640,7 +20651,7 @@ function tryRemoveDirectoryPrefix(path, dirPath, getCanonicalFileName) {
|
|
|
20640
20651
|
const withoutPrefix = tryRemovePrefix(path, dirPath, getCanonicalFileName);
|
|
20641
20652
|
return withoutPrefix === void 0 ? void 0 : stripLeadingDirectorySeparator(withoutPrefix);
|
|
20642
20653
|
}
|
|
20643
|
-
var reservedCharacterPattern = /[^\w\s
|
|
20654
|
+
var reservedCharacterPattern = /[^\w\s/]/g;
|
|
20644
20655
|
function regExpEscape(text) {
|
|
20645
20656
|
return text.replace(reservedCharacterPattern, escapeRegExpCharacter);
|
|
20646
20657
|
}
|
|
@@ -47753,6 +47764,7 @@ function createTypeChecker(host) {
|
|
|
47753
47764
|
var moduleKind = getEmitModuleKind(compilerOptions);
|
|
47754
47765
|
var legacyDecorators = !!compilerOptions.experimentalDecorators;
|
|
47755
47766
|
var useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
47767
|
+
var emitStandardClassFields = getEmitStandardClassFields(compilerOptions);
|
|
47756
47768
|
var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions);
|
|
47757
47769
|
var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
47758
47770
|
var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
@@ -49107,7 +49119,7 @@ function createTypeChecker(host) {
|
|
|
49107
49119
|
false
|
|
49108
49120
|
);
|
|
49109
49121
|
} else if (isParameterPropertyDeclaration(declaration, declaration.parent)) {
|
|
49110
|
-
return !(
|
|
49122
|
+
return !(emitStandardClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration));
|
|
49111
49123
|
}
|
|
49112
49124
|
return true;
|
|
49113
49125
|
}
|
|
@@ -49121,7 +49133,7 @@ function createTypeChecker(host) {
|
|
|
49121
49133
|
return true;
|
|
49122
49134
|
}
|
|
49123
49135
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
49124
|
-
if (
|
|
49136
|
+
if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
|
|
49125
49137
|
return !isPropertyImmediatelyReferencedWithinDeclaration(
|
|
49126
49138
|
declaration,
|
|
49127
49139
|
usage,
|
|
@@ -49245,7 +49257,7 @@ function createTypeChecker(host) {
|
|
|
49245
49257
|
return requiresScopeChangeWorker(node.name);
|
|
49246
49258
|
case 172 /* PropertyDeclaration */:
|
|
49247
49259
|
if (hasStaticModifier(node)) {
|
|
49248
|
-
return
|
|
49260
|
+
return !emitStandardClassFields;
|
|
49249
49261
|
}
|
|
49250
49262
|
return requiresScopeChangeWorker(node.name);
|
|
49251
49263
|
default:
|
|
@@ -49516,7 +49528,7 @@ function createTypeChecker(host) {
|
|
|
49516
49528
|
}
|
|
49517
49529
|
}
|
|
49518
49530
|
function checkAndReportErrorForInvalidInitializer() {
|
|
49519
|
-
if (propertyWithInvalidInitializer && !
|
|
49531
|
+
if (propertyWithInvalidInitializer && !emitStandardClassFields) {
|
|
49520
49532
|
error2(
|
|
49521
49533
|
errorLocation,
|
|
49522
49534
|
errorLocation && propertyWithInvalidInitializer.type && textRangeContainsPositionInclusive(propertyWithInvalidInitializer.type, errorLocation.pos) ? Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor : Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,
|
|
@@ -61072,6 +61084,9 @@ function createTypeChecker(host) {
|
|
|
61072
61084
|
function getEndElementCount(type, flags) {
|
|
61073
61085
|
return type.elementFlags.length - findLastIndex(type.elementFlags, (f) => !(f & flags)) - 1;
|
|
61074
61086
|
}
|
|
61087
|
+
function getTotalFixedElementCount(type) {
|
|
61088
|
+
return type.fixedLength + getEndElementCount(type, 3 /* Fixed */);
|
|
61089
|
+
}
|
|
61075
61090
|
function getElementTypes(type) {
|
|
61076
61091
|
const typeArguments = getTypeArguments(type);
|
|
61077
61092
|
const arity = getTypeReferenceArity(type);
|
|
@@ -61977,10 +61992,7 @@ function createTypeChecker(host) {
|
|
|
61977
61992
|
}
|
|
61978
61993
|
if (index >= 0) {
|
|
61979
61994
|
errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
|
|
61980
|
-
return
|
|
61981
|
-
const restType = getRestTypeOfTupleType(t) || undefinedType;
|
|
61982
|
-
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
|
|
61983
|
-
});
|
|
61995
|
+
return getTupleElementTypeOutOfStartCount(objectType, index, accessFlags & 1 /* IncludeUndefined */ ? missingType : void 0);
|
|
61984
61996
|
}
|
|
61985
61997
|
}
|
|
61986
61998
|
}
|
|
@@ -62265,7 +62277,7 @@ function createTypeChecker(host) {
|
|
|
62265
62277
|
}
|
|
62266
62278
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
62267
62279
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
62268
|
-
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target
|
|
62280
|
+
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) {
|
|
62269
62281
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
62270
62282
|
return objectType;
|
|
62271
62283
|
}
|
|
@@ -67276,17 +67288,7 @@ function createTypeChecker(host) {
|
|
|
67276
67288
|
return propType;
|
|
67277
67289
|
}
|
|
67278
67290
|
if (everyType(type, isTupleType)) {
|
|
67279
|
-
return
|
|
67280
|
-
const tupleType = t;
|
|
67281
|
-
const restType = getRestTypeOfTupleType(tupleType);
|
|
67282
|
-
if (!restType) {
|
|
67283
|
-
return undefinedType;
|
|
67284
|
-
}
|
|
67285
|
-
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
67286
|
-
return getUnionType([restType, undefinedType]);
|
|
67287
|
-
}
|
|
67288
|
-
return restType;
|
|
67289
|
-
});
|
|
67291
|
+
return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
67290
67292
|
}
|
|
67291
67293
|
return void 0;
|
|
67292
67294
|
}
|
|
@@ -67354,6 +67356,19 @@ function createTypeChecker(host) {
|
|
|
67354
67356
|
function getRestTypeOfTupleType(type) {
|
|
67355
67357
|
return getElementTypeOfSliceOfTupleType(type, type.target.fixedLength);
|
|
67356
67358
|
}
|
|
67359
|
+
function getTupleElementTypeOutOfStartCount(type, index, undefinedOrMissingType2) {
|
|
67360
|
+
return mapType(type, (t) => {
|
|
67361
|
+
const tupleType = t;
|
|
67362
|
+
const restType = getRestTypeOfTupleType(tupleType);
|
|
67363
|
+
if (!restType) {
|
|
67364
|
+
return undefinedType;
|
|
67365
|
+
}
|
|
67366
|
+
if (undefinedOrMissingType2 && index >= getTotalFixedElementCount(tupleType.target)) {
|
|
67367
|
+
return getUnionType([restType, undefinedOrMissingType2]);
|
|
67368
|
+
}
|
|
67369
|
+
return restType;
|
|
67370
|
+
});
|
|
67371
|
+
}
|
|
67357
67372
|
function getRestArrayTypeOfTupleType(type) {
|
|
67358
67373
|
const restType = getRestTypeOfTupleType(type);
|
|
67359
67374
|
return restType && createArrayType(restType);
|
|
@@ -68853,12 +68868,6 @@ function createTypeChecker(host) {
|
|
|
68853
68868
|
}
|
|
68854
68869
|
return links.resolvedSymbol;
|
|
68855
68870
|
}
|
|
68856
|
-
function isInTypeQuery(node) {
|
|
68857
|
-
return !!findAncestor(
|
|
68858
|
-
node,
|
|
68859
|
-
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
68860
|
-
);
|
|
68861
|
-
}
|
|
68862
68871
|
function isInAmbientOrTypeNode(node) {
|
|
68863
68872
|
return !!(node.flags & 33554432 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n)));
|
|
68864
68873
|
}
|
|
@@ -74081,7 +74090,7 @@ function createTypeChecker(host) {
|
|
|
74081
74090
|
}
|
|
74082
74091
|
let diagnosticMessage;
|
|
74083
74092
|
const declarationName = idText(right);
|
|
74084
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (
|
|
74093
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
74085
74094
|
diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
74086
74095
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
74087
74096
|
diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -79793,7 +79802,7 @@ function createTypeChecker(host) {
|
|
|
79793
79802
|
case "length":
|
|
79794
79803
|
case "caller":
|
|
79795
79804
|
case "arguments":
|
|
79796
|
-
if (
|
|
79805
|
+
if (useDefineForClassFields) {
|
|
79797
79806
|
break;
|
|
79798
79807
|
}
|
|
79799
79808
|
case "prototype":
|
|
@@ -79941,7 +79950,7 @@ function createTypeChecker(host) {
|
|
|
79941
79950
|
if (classExtendsNull) {
|
|
79942
79951
|
error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
79943
79952
|
}
|
|
79944
|
-
const superCallShouldBeRootLevel =
|
|
79953
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */)));
|
|
79945
79954
|
if (superCallShouldBeRootLevel) {
|
|
79946
79955
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
79947
79956
|
error2(superCall, Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);
|
|
@@ -83220,7 +83229,7 @@ function createTypeChecker(host) {
|
|
|
83220
83229
|
node
|
|
83221
83230
|
);
|
|
83222
83231
|
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */;
|
|
83223
|
-
const willTransformInitializers = !
|
|
83232
|
+
const willTransformInitializers = !emitStandardClassFields;
|
|
83224
83233
|
if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
|
|
83225
83234
|
for (const member of node.members) {
|
|
83226
83235
|
if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated(
|
|
@@ -135887,7 +135896,7 @@ function preProcessFile(sourceText, readImportFiles = true, detectJavaScriptImpo
|
|
|
135887
135896
|
}
|
|
135888
135897
|
|
|
135889
135898
|
// src/services/sourcemaps.ts
|
|
135890
|
-
var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9
|
|
135899
|
+
var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+/=]+)$)?/;
|
|
135891
135900
|
function getSourceMapper(host) {
|
|
135892
135901
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
135893
135902
|
const currentDirectory = host.getCurrentDirectory();
|
|
@@ -144669,7 +144678,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
144669
144678
|
}
|
|
144670
144679
|
return result;
|
|
144671
144680
|
function escapeRegExp(str) {
|
|
144672
|
-
return str.replace(/[
|
|
144681
|
+
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
|
|
144673
144682
|
}
|
|
144674
144683
|
function getTodoCommentsRegExp() {
|
|
144675
144684
|
const singleLineCommentStart = /(?:\/\/+\s*)/.source;
|
|
@@ -149695,7 +149704,7 @@ function getLeftAndRightSiblings(typedefNode) {
|
|
|
149695
149704
|
function findEndOfTextBetween(jsDocComment, from, to) {
|
|
149696
149705
|
const comment = jsDocComment.getText().substring(from - jsDocComment.getStart(), to - jsDocComment.getStart());
|
|
149697
149706
|
for (let i = comment.length; i > 0; i--) {
|
|
149698
|
-
if (!/[
|
|
149707
|
+
if (!/[*/\s]/g.test(comment.substring(i - 1, i))) {
|
|
149699
149708
|
return from + i;
|
|
149700
149709
|
}
|
|
149701
149710
|
}
|
|
@@ -153043,7 +153052,7 @@ function doChange22(changes, sourceFile, arg, expression) {
|
|
|
153043
153052
|
);
|
|
153044
153053
|
}
|
|
153045
153054
|
function getSuggestion(messageText) {
|
|
153046
|
-
const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(
|
|
153055
|
+
const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || [];
|
|
153047
153056
|
return suggestion;
|
|
153048
153057
|
}
|
|
153049
153058
|
|
|
@@ -158875,7 +158884,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
158875
158884
|
return { kind: 1 /* JsDocTagName */ };
|
|
158876
158885
|
} else {
|
|
158877
158886
|
const lineStart = getLineStartPositionForPosition(position, sourceFile);
|
|
158878
|
-
if (!/[
|
|
158887
|
+
if (!/[^*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) {
|
|
158879
158888
|
return { kind: 2 /* JsDocTag */ };
|
|
158880
158889
|
}
|
|
158881
158890
|
}
|
|
@@ -159174,24 +159183,34 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
159174
159183
|
}
|
|
159175
159184
|
}
|
|
159176
159185
|
}
|
|
159177
|
-
if (!isTypeLocation) {
|
|
159186
|
+
if (!isTypeLocation || isInTypeQuery(node)) {
|
|
159178
159187
|
typeChecker.tryGetThisTypeAt(
|
|
159179
159188
|
node,
|
|
159180
159189
|
/*includeGlobalThis*/
|
|
159181
159190
|
false
|
|
159182
159191
|
);
|
|
159183
159192
|
let type = typeChecker.getTypeAtLocation(node).getNonOptionalType();
|
|
159184
|
-
|
|
159185
|
-
|
|
159186
|
-
|
|
159187
|
-
|
|
159188
|
-
|
|
159189
|
-
|
|
159190
|
-
|
|
159193
|
+
if (!isTypeLocation) {
|
|
159194
|
+
let insertQuestionDot = false;
|
|
159195
|
+
if (type.isNullableType()) {
|
|
159196
|
+
const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false;
|
|
159197
|
+
if (canCorrectToQuestionDot || isRightOfQuestionDot) {
|
|
159198
|
+
type = type.getNonNullableType();
|
|
159199
|
+
if (canCorrectToQuestionDot) {
|
|
159200
|
+
insertQuestionDot = true;
|
|
159201
|
+
}
|
|
159191
159202
|
}
|
|
159192
159203
|
}
|
|
159204
|
+
addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot);
|
|
159205
|
+
} else {
|
|
159206
|
+
addTypeProperties(
|
|
159207
|
+
type.getNonNullableType(),
|
|
159208
|
+
/*insertAwait*/
|
|
159209
|
+
false,
|
|
159210
|
+
/*insertQuestionDot*/
|
|
159211
|
+
false
|
|
159212
|
+
);
|
|
159193
159213
|
}
|
|
159194
|
-
addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot);
|
|
159195
159214
|
}
|
|
159196
159215
|
}
|
|
159197
159216
|
function addTypeProperties(type, insertAwait, insertQuestionDot) {
|
|
@@ -172643,6 +172662,7 @@ __export(ts_exports2, {
|
|
|
172643
172662
|
getEmitModuleKind: () => getEmitModuleKind,
|
|
172644
172663
|
getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
|
|
172645
172664
|
getEmitScriptTarget: () => getEmitScriptTarget,
|
|
172665
|
+
getEmitStandardClassFields: () => getEmitStandardClassFields,
|
|
172646
172666
|
getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer,
|
|
172647
172667
|
getEnclosingContainer: () => getEnclosingContainer,
|
|
172648
172668
|
getEncodedSemanticClassifications: () => getEncodedSemanticClassifications,
|
|
@@ -173318,6 +173338,7 @@ __export(ts_exports2, {
|
|
|
173318
173338
|
isInString: () => isInString,
|
|
173319
173339
|
isInTemplateString: () => isInTemplateString,
|
|
173320
173340
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
173341
|
+
isInTypeQuery: () => isInTypeQuery,
|
|
173321
173342
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
173322
173343
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
173323
173344
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|
|
@@ -178187,7 +178208,7 @@ var indentStyle = new Map(Object.entries({
|
|
|
178187
178208
|
var defaultTypeSafeList = {
|
|
178188
178209
|
"jquery": {
|
|
178189
178210
|
// jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js")
|
|
178190
|
-
match: /jquery(-[\d
|
|
178211
|
+
match: /jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i,
|
|
178191
178212
|
types: ["jquery"]
|
|
178192
178213
|
},
|
|
178193
178214
|
"WinJS": {
|
|
@@ -181089,7 +181110,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181089
181110
|
}
|
|
181090
181111
|
}
|
|
181091
181112
|
if (!exclude) {
|
|
181092
|
-
if (/^.+[
|
|
181113
|
+
if (/^.+[.-]min\.js$/.test(normalizedNames[i])) {
|
|
181093
181114
|
excludedFiles.push(normalizedNames[i]);
|
|
181094
181115
|
} else {
|
|
181095
181116
|
filesToKeep.push(proj.rootFiles[i]);
|
|
@@ -181410,7 +181431,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181410
181431
|
}
|
|
181411
181432
|
};
|
|
181412
181433
|
/** Makes a filename safe to insert in a RegExp */
|
|
181413
|
-
_ProjectService.filenameEscapeRegexp = /[
|
|
181434
|
+
_ProjectService.filenameEscapeRegexp = /[-/\\^$*+?.()|[\]{}]/g;
|
|
181414
181435
|
var ProjectService3 = _ProjectService;
|
|
181415
181436
|
function createIncompleteCompletionsCache() {
|
|
181416
181437
|
let info;
|
|
@@ -187171,6 +187192,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187171
187192
|
getEmitModuleKind,
|
|
187172
187193
|
getEmitModuleResolutionKind,
|
|
187173
187194
|
getEmitScriptTarget,
|
|
187195
|
+
getEmitStandardClassFields,
|
|
187174
187196
|
getEnclosingBlockScopeContainer,
|
|
187175
187197
|
getEnclosingContainer,
|
|
187176
187198
|
getEncodedSemanticClassifications,
|
|
@@ -187846,6 +187868,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187846
187868
|
isInString,
|
|
187847
187869
|
isInTemplateString,
|
|
187848
187870
|
isInTopLevelContext,
|
|
187871
|
+
isInTypeQuery,
|
|
187849
187872
|
isIncrementalCompilation,
|
|
187850
187873
|
isIndexSignatureDeclaration,
|
|
187851
187874
|
isIndexedAccessTypeNode,
|