@typescript-deploys/pr-build 5.6.0-pr-59514-2 → 5.6.0-pr-59523-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +22 -10
- package/lib/typescript.js +124 -32
- package/lib/zh-tw/diagnosticMessages.generated.json +281 -281
- package/package.json +10 -10
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240803`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -25403,7 +25403,7 @@ var asyncGeneratorHelper = {
|
|
|
25403
25403
|
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
25404
25404
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
25405
25405
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
25406
|
-
return i =
|
|
25406
|
+
return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
25407
25407
|
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
25408
25408
|
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
25409
25409
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
@@ -25585,8 +25585,8 @@ var generatorHelper = {
|
|
|
25585
25585
|
priority: 6,
|
|
25586
25586
|
text: `
|
|
25587
25587
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25588
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
25589
|
-
return g
|
|
25588
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25589
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25590
25590
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25591
25591
|
function step(op) {
|
|
25592
25592
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -72892,8 +72892,21 @@ function createTypeChecker(host) {
|
|
|
72892
72892
|
function getEnclosingClassFromThisParameter(node) {
|
|
72893
72893
|
const thisParameter = getThisParameterFromNodeContext(node);
|
|
72894
72894
|
let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
|
|
72895
|
-
if (thisType
|
|
72896
|
-
thisType
|
|
72895
|
+
if (thisType) {
|
|
72896
|
+
if (thisType.flags & 262144 /* TypeParameter */) {
|
|
72897
|
+
thisType = getConstraintOfTypeParameter(thisType);
|
|
72898
|
+
}
|
|
72899
|
+
} else {
|
|
72900
|
+
const thisContainer = getThisContainer(
|
|
72901
|
+
node,
|
|
72902
|
+
/*includeArrowFunctions*/
|
|
72903
|
+
false,
|
|
72904
|
+
/*includeClassComputedPropertyName*/
|
|
72905
|
+
false
|
|
72906
|
+
);
|
|
72907
|
+
if (isFunctionLike(thisContainer)) {
|
|
72908
|
+
thisType = getContextualThisParameterType(thisContainer);
|
|
72909
|
+
}
|
|
72897
72910
|
}
|
|
72898
72911
|
if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
|
|
72899
72912
|
return getTargetType(thisType);
|
|
@@ -79046,9 +79059,7 @@ function createTypeChecker(host) {
|
|
|
79046
79059
|
}
|
|
79047
79060
|
checkSourceElement(node.type);
|
|
79048
79061
|
const { parameterName } = node;
|
|
79049
|
-
if (typePredicate.kind
|
|
79050
|
-
getTypeFromThisTypeNode(parameterName);
|
|
79051
|
-
} else {
|
|
79062
|
+
if (typePredicate.kind !== 0 /* This */ && typePredicate.kind !== 2 /* AssertsThis */) {
|
|
79052
79063
|
if (typePredicate.parameterIndex >= 0) {
|
|
79053
79064
|
if (signatureHasRestParameter(signature) && typePredicate.parameterIndex === signature.parameters.length - 1) {
|
|
79054
79065
|
error(parameterName, Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter);
|
|
@@ -81397,7 +81408,7 @@ function createTypeChecker(host) {
|
|
|
81397
81408
|
bothHelper(location, body2);
|
|
81398
81409
|
return;
|
|
81399
81410
|
}
|
|
81400
|
-
const type = location === condExpr2 ? condType :
|
|
81411
|
+
const type = location === condExpr2 ? condType : checkExpression(location);
|
|
81401
81412
|
if (type.flags & 1024 /* EnumLiteral */ && isPropertyAccessExpression(location) && (getNodeLinks(location.expression).resolvedSymbol ?? unknownSymbol).flags & 384 /* Enum */) {
|
|
81402
81413
|
error(location, Diagnostics.This_condition_will_always_return_0, !!type.value ? "true" : "false");
|
|
81403
81414
|
return;
|
|
@@ -83592,6 +83603,7 @@ function createTypeChecker(host) {
|
|
|
83592
83603
|
grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
|
|
83593
83604
|
break;
|
|
83594
83605
|
case 271 /* ImportEqualsDeclaration */:
|
|
83606
|
+
if (isInternalModuleImportEqualsDeclaration(node)) break;
|
|
83595
83607
|
case 272 /* ImportDeclaration */:
|
|
83596
83608
|
grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
|
|
83597
83609
|
break;
|
package/lib/typescript.js
CHANGED
|
@@ -2260,7 +2260,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2260
2260
|
|
|
2261
2261
|
// src/compiler/corePublic.ts
|
|
2262
2262
|
var versionMajorMinor = "5.6";
|
|
2263
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2263
|
+
var version = `${versionMajorMinor}.0-insiders.20240803`;
|
|
2264
2264
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2265
2265
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2266
2266
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -29552,7 +29552,7 @@ var asyncGeneratorHelper = {
|
|
|
29552
29552
|
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
29553
29553
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
29554
29554
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
29555
|
-
return i =
|
|
29555
|
+
return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
29556
29556
|
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
29557
29557
|
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
29558
29558
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
@@ -29734,8 +29734,8 @@ var generatorHelper = {
|
|
|
29734
29734
|
priority: 6,
|
|
29735
29735
|
text: `
|
|
29736
29736
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
29737
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
29738
|
-
return g
|
|
29737
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
29738
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29739
29739
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29740
29740
|
function step(op) {
|
|
29741
29741
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -77511,8 +77511,21 @@ function createTypeChecker(host) {
|
|
|
77511
77511
|
function getEnclosingClassFromThisParameter(node) {
|
|
77512
77512
|
const thisParameter = getThisParameterFromNodeContext(node);
|
|
77513
77513
|
let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
|
|
77514
|
-
if (thisType
|
|
77515
|
-
thisType
|
|
77514
|
+
if (thisType) {
|
|
77515
|
+
if (thisType.flags & 262144 /* TypeParameter */) {
|
|
77516
|
+
thisType = getConstraintOfTypeParameter(thisType);
|
|
77517
|
+
}
|
|
77518
|
+
} else {
|
|
77519
|
+
const thisContainer = getThisContainer(
|
|
77520
|
+
node,
|
|
77521
|
+
/*includeArrowFunctions*/
|
|
77522
|
+
false,
|
|
77523
|
+
/*includeClassComputedPropertyName*/
|
|
77524
|
+
false
|
|
77525
|
+
);
|
|
77526
|
+
if (isFunctionLike(thisContainer)) {
|
|
77527
|
+
thisType = getContextualThisParameterType(thisContainer);
|
|
77528
|
+
}
|
|
77516
77529
|
}
|
|
77517
77530
|
if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
|
|
77518
77531
|
return getTargetType(thisType);
|
|
@@ -83665,9 +83678,7 @@ function createTypeChecker(host) {
|
|
|
83665
83678
|
}
|
|
83666
83679
|
checkSourceElement(node.type);
|
|
83667
83680
|
const { parameterName } = node;
|
|
83668
|
-
if (typePredicate.kind
|
|
83669
|
-
getTypeFromThisTypeNode(parameterName);
|
|
83670
|
-
} else {
|
|
83681
|
+
if (typePredicate.kind !== 0 /* This */ && typePredicate.kind !== 2 /* AssertsThis */) {
|
|
83671
83682
|
if (typePredicate.parameterIndex >= 0) {
|
|
83672
83683
|
if (signatureHasRestParameter(signature) && typePredicate.parameterIndex === signature.parameters.length - 1) {
|
|
83673
83684
|
error2(parameterName, Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter);
|
|
@@ -86016,7 +86027,7 @@ function createTypeChecker(host) {
|
|
|
86016
86027
|
bothHelper(location, body2);
|
|
86017
86028
|
return;
|
|
86018
86029
|
}
|
|
86019
|
-
const type = location === condExpr2 ? condType :
|
|
86030
|
+
const type = location === condExpr2 ? condType : checkExpression(location);
|
|
86020
86031
|
if (type.flags & 1024 /* EnumLiteral */ && isPropertyAccessExpression(location) && (getNodeLinks(location.expression).resolvedSymbol ?? unknownSymbol).flags & 384 /* Enum */) {
|
|
86021
86032
|
error2(location, Diagnostics.This_condition_will_always_return_0, !!type.value ? "true" : "false");
|
|
86022
86033
|
return;
|
|
@@ -88211,6 +88222,7 @@ function createTypeChecker(host) {
|
|
|
88211
88222
|
grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
|
|
88212
88223
|
break;
|
|
88213
88224
|
case 271 /* ImportEqualsDeclaration */:
|
|
88225
|
+
if (isInternalModuleImportEqualsDeclaration(node)) break;
|
|
88214
88226
|
case 272 /* ImportDeclaration */:
|
|
88215
88227
|
grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
|
|
88216
88228
|
break;
|
|
@@ -163133,6 +163145,8 @@ var SortText = {
|
|
|
163133
163145
|
return sortText + "1";
|
|
163134
163146
|
}
|
|
163135
163147
|
};
|
|
163148
|
+
var allCommitCharacters = [".", ",", ";"];
|
|
163149
|
+
var noCommaCommitCharacters = [".", ";"];
|
|
163136
163150
|
var CompletionSource = /* @__PURE__ */ ((CompletionSource2) => {
|
|
163137
163151
|
CompletionSource2["ThisProperty"] = "ThisProperty/";
|
|
163138
163152
|
CompletionSource2["ClassMemberSnippet"] = "ClassMemberSnippet/";
|
|
@@ -163239,7 +163253,7 @@ function getDefaultCommitCharacters(isNewIdentifierLocation) {
|
|
|
163239
163253
|
if (isNewIdentifierLocation) {
|
|
163240
163254
|
return [];
|
|
163241
163255
|
}
|
|
163242
|
-
return
|
|
163256
|
+
return allCommitCharacters;
|
|
163243
163257
|
}
|
|
163244
163258
|
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
163245
163259
|
var _a;
|
|
@@ -163737,7 +163751,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
|
|
|
163737
163751
|
importStatementCompletion,
|
|
163738
163752
|
insideJsDocTagTypeExpression,
|
|
163739
163753
|
symbolToSortTextMap,
|
|
163740
|
-
hasUnresolvedAutoImports
|
|
163754
|
+
hasUnresolvedAutoImports,
|
|
163755
|
+
defaultCommitCharacters
|
|
163741
163756
|
} = completionData;
|
|
163742
163757
|
let literals = completionData.literals;
|
|
163743
163758
|
const checker = program.getTypeChecker();
|
|
@@ -163855,7 +163870,7 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
|
|
|
163855
163870
|
isNewIdentifierLocation,
|
|
163856
163871
|
optionalReplacementSpan: getOptionalReplacementSpan(location),
|
|
163857
163872
|
entries,
|
|
163858
|
-
defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation)
|
|
163873
|
+
defaultCommitCharacters: defaultCommitCharacters ?? getDefaultCommitCharacters(isNewIdentifierLocation)
|
|
163859
163874
|
};
|
|
163860
163875
|
}
|
|
163861
163876
|
function isCheckedFile(sourceFile, compilerOptions) {
|
|
@@ -165247,6 +165262,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
165247
165262
|
let keywordFilters = 0 /* None */;
|
|
165248
165263
|
let isNewIdentifierLocation = false;
|
|
165249
165264
|
let flags = 0 /* None */;
|
|
165265
|
+
let defaultCommitCharacters;
|
|
165250
165266
|
if (contextToken) {
|
|
165251
165267
|
const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile);
|
|
165252
165268
|
if (importStatementCompletionInfo.keywordCompletion) {
|
|
@@ -165266,7 +165282,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
165266
165282
|
}
|
|
165267
165283
|
if (!importStatementCompletionInfo.replacementSpan && isCompletionListBlocker(contextToken)) {
|
|
165268
165284
|
log("Returning an empty list because completion was requested in an invalid position.");
|
|
165269
|
-
return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation,
|
|
165285
|
+
return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, computeCommitCharactersAndIsNewIdentifier().isNewIdentifierLocation) : void 0;
|
|
165270
165286
|
}
|
|
165271
165287
|
let parent2 = contextToken.parent;
|
|
165272
165288
|
if (contextToken.kind === 25 /* DotToken */ || contextToken.kind === 29 /* QuestionDotToken */) {
|
|
@@ -165425,7 +165441,8 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
165425
165441
|
isRightOfDotOrQuestionDot: isRightOfDot || isRightOfQuestionDot,
|
|
165426
165442
|
importStatementCompletion,
|
|
165427
165443
|
hasUnresolvedAutoImports,
|
|
165428
|
-
flags
|
|
165444
|
+
flags,
|
|
165445
|
+
defaultCommitCharacters
|
|
165429
165446
|
};
|
|
165430
165447
|
function isTagWithTypeExpression(tag) {
|
|
165431
165448
|
switch (tag.kind) {
|
|
@@ -165460,7 +165477,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
165460
165477
|
const isRhsOfImportDeclaration = isInRightSideOfInternalImportEqualsDeclaration(node);
|
|
165461
165478
|
if (isEntityName(node) || isImportType || isPropertyAccessExpression(node)) {
|
|
165462
165479
|
const isNamespaceName = isModuleDeclaration(node.parent);
|
|
165463
|
-
if (isNamespaceName)
|
|
165480
|
+
if (isNamespaceName) {
|
|
165481
|
+
isNewIdentifierLocation = true;
|
|
165482
|
+
defaultCommitCharacters = [];
|
|
165483
|
+
}
|
|
165464
165484
|
let symbol = typeChecker.getSymbolAtLocation(node);
|
|
165465
165485
|
if (symbol) {
|
|
165466
165486
|
symbol = skipAlias(symbol, typeChecker);
|
|
@@ -165530,9 +165550,13 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
165530
165550
|
}
|
|
165531
165551
|
}
|
|
165532
165552
|
function addTypeProperties(type, insertAwait, insertQuestionDot) {
|
|
165533
|
-
|
|
165553
|
+
if (type.getStringIndexType()) {
|
|
165554
|
+
isNewIdentifierLocation = true;
|
|
165555
|
+
defaultCommitCharacters = [];
|
|
165556
|
+
}
|
|
165534
165557
|
if (isRightOfQuestionDot && some(type.getCallSignatures())) {
|
|
165535
165558
|
isNewIdentifierLocation = true;
|
|
165559
|
+
defaultCommitCharacters ?? (defaultCommitCharacters = allCommitCharacters);
|
|
165536
165560
|
}
|
|
165537
165561
|
const propertyAccess = node.kind === 205 /* ImportType */ ? node : node.parent;
|
|
165538
165562
|
if (inCheckedFile) {
|
|
@@ -165671,7 +165695,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
165671
165695
|
function getGlobalCompletions() {
|
|
165672
165696
|
keywordFilters = tryGetFunctionLikeBodyCompletionContainer(contextToken) ? 5 /* FunctionLikeBodyKeywords */ : 1 /* All */;
|
|
165673
165697
|
completionKind = 1 /* Global */;
|
|
165674
|
-
isNewIdentifierLocation =
|
|
165698
|
+
({ isNewIdentifierLocation, defaultCommitCharacters } = computeCommitCharactersAndIsNewIdentifier());
|
|
165675
165699
|
if (previousToken !== contextToken) {
|
|
165676
165700
|
Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'.");
|
|
165677
165701
|
}
|
|
@@ -165937,41 +165961,109 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
165937
165961
|
}
|
|
165938
165962
|
return false;
|
|
165939
165963
|
}
|
|
165940
|
-
function
|
|
165964
|
+
function computeCommitCharactersAndIsNewIdentifier() {
|
|
165941
165965
|
if (contextToken) {
|
|
165942
165966
|
const containingNodeKind = contextToken.parent.kind;
|
|
165943
165967
|
const tokenKind = keywordForNode(contextToken);
|
|
165944
165968
|
switch (tokenKind) {
|
|
165945
165969
|
case 28 /* CommaToken */:
|
|
165946
|
-
|
|
165970
|
+
switch (containingNodeKind) {
|
|
165971
|
+
case 213 /* CallExpression */:
|
|
165972
|
+
case 214 /* NewExpression */: {
|
|
165973
|
+
const expression = contextToken.parent.expression;
|
|
165974
|
+
if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) {
|
|
165975
|
+
return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true };
|
|
165976
|
+
}
|
|
165977
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
|
|
165978
|
+
}
|
|
165979
|
+
case 226 /* BinaryExpression */:
|
|
165980
|
+
return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true };
|
|
165981
|
+
case 176 /* Constructor */:
|
|
165982
|
+
case 184 /* FunctionType */:
|
|
165983
|
+
case 210 /* ObjectLiteralExpression */:
|
|
165984
|
+
return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
|
|
165985
|
+
case 209 /* ArrayLiteralExpression */:
|
|
165986
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
|
|
165987
|
+
default:
|
|
165988
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
165989
|
+
}
|
|
165947
165990
|
case 21 /* OpenParenToken */:
|
|
165948
|
-
|
|
165991
|
+
switch (containingNodeKind) {
|
|
165992
|
+
case 213 /* CallExpression */:
|
|
165993
|
+
case 214 /* NewExpression */: {
|
|
165994
|
+
const expression = contextToken.parent.expression;
|
|
165995
|
+
if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) {
|
|
165996
|
+
return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true };
|
|
165997
|
+
}
|
|
165998
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
|
|
165999
|
+
}
|
|
166000
|
+
case 217 /* ParenthesizedExpression */:
|
|
166001
|
+
return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true };
|
|
166002
|
+
case 176 /* Constructor */:
|
|
166003
|
+
case 196 /* ParenthesizedType */:
|
|
166004
|
+
return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
|
|
166005
|
+
default:
|
|
166006
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
166007
|
+
}
|
|
165949
166008
|
case 23 /* OpenBracketToken */:
|
|
165950
|
-
|
|
166009
|
+
switch (containingNodeKind) {
|
|
166010
|
+
case 209 /* ArrayLiteralExpression */:
|
|
166011
|
+
case 181 /* IndexSignature */:
|
|
166012
|
+
case 189 /* TupleType */:
|
|
166013
|
+
case 167 /* ComputedPropertyName */:
|
|
166014
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
|
|
166015
|
+
default:
|
|
166016
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
166017
|
+
}
|
|
165951
166018
|
case 144 /* ModuleKeyword */:
|
|
165952
166019
|
case 145 /* NamespaceKeyword */:
|
|
165953
166020
|
case 102 /* ImportKeyword */:
|
|
165954
|
-
return true;
|
|
166021
|
+
return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
|
|
165955
166022
|
case 25 /* DotToken */:
|
|
165956
|
-
|
|
166023
|
+
switch (containingNodeKind) {
|
|
166024
|
+
case 267 /* ModuleDeclaration */:
|
|
166025
|
+
return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
|
|
166026
|
+
default:
|
|
166027
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
166028
|
+
}
|
|
165957
166029
|
case 19 /* OpenBraceToken */:
|
|
165958
|
-
|
|
166030
|
+
switch (containingNodeKind) {
|
|
166031
|
+
case 263 /* ClassDeclaration */:
|
|
166032
|
+
case 210 /* ObjectLiteralExpression */:
|
|
166033
|
+
return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
|
|
166034
|
+
default:
|
|
166035
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
166036
|
+
}
|
|
165959
166037
|
case 64 /* EqualsToken */:
|
|
165960
|
-
|
|
166038
|
+
switch (containingNodeKind) {
|
|
166039
|
+
case 260 /* VariableDeclaration */:
|
|
166040
|
+
case 226 /* BinaryExpression */:
|
|
166041
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
|
|
166042
|
+
default:
|
|
166043
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
166044
|
+
}
|
|
165961
166045
|
case 16 /* TemplateHead */:
|
|
165962
|
-
return
|
|
166046
|
+
return {
|
|
166047
|
+
defaultCommitCharacters: allCommitCharacters,
|
|
166048
|
+
isNewIdentifierLocation: containingNodeKind === 228 /* TemplateExpression */
|
|
166049
|
+
// `aa ${|
|
|
166050
|
+
};
|
|
165963
166051
|
case 17 /* TemplateMiddle */:
|
|
165964
|
-
return
|
|
166052
|
+
return {
|
|
166053
|
+
defaultCommitCharacters: allCommitCharacters,
|
|
166054
|
+
isNewIdentifierLocation: containingNodeKind === 239 /* TemplateSpan */
|
|
166055
|
+
// `aa ${10} dd ${|
|
|
166056
|
+
};
|
|
165965
166057
|
case 134 /* AsyncKeyword */:
|
|
165966
|
-
return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 304 /* ShorthandPropertyAssignment
|
|
166058
|
+
return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 304 /* ShorthandPropertyAssignment */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
165967
166059
|
case 42 /* AsteriskToken */:
|
|
165968
|
-
return containingNodeKind === 174 /* MethodDeclaration
|
|
166060
|
+
return containingNodeKind === 174 /* MethodDeclaration */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
165969
166061
|
}
|
|
165970
166062
|
if (isClassMemberCompletionKeyword(tokenKind)) {
|
|
165971
|
-
return true;
|
|
166063
|
+
return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
|
|
165972
166064
|
}
|
|
165973
166065
|
}
|
|
165974
|
-
return false;
|
|
166066
|
+
return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
|
|
165975
166067
|
}
|
|
165976
166068
|
function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) {
|
|
165977
166069
|
return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
|