typescript 5.2.0-dev.20230517 → 5.2.0-dev.20230518
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 +79 -30
- package/lib/tsserverlibrary.d.ts +6 -0
- package/lib/tsserverlibrary.js +79 -30
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +77 -30
- package/lib/typingsInstaller.js +6 -2
- package/package.json +2 -2
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.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230518`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -18559,7 +18559,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18559
18559
|
ensureUseStrict,
|
|
18560
18560
|
liftToBlock,
|
|
18561
18561
|
mergeLexicalEnvironment,
|
|
18562
|
-
updateModifiers
|
|
18562
|
+
updateModifiers,
|
|
18563
|
+
updateModifierLike
|
|
18563
18564
|
};
|
|
18564
18565
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
18565
18566
|
return factory2;
|
|
@@ -22041,6 +22042,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22041
22042
|
}
|
|
22042
22043
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
22043
22044
|
}
|
|
22045
|
+
function updateModifierLike(node, modifierArray) {
|
|
22046
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
22047
|
+
}
|
|
22044
22048
|
function asNodeArray(array) {
|
|
22045
22049
|
return array ? createNodeArray(array) : void 0;
|
|
22046
22050
|
}
|
|
@@ -23366,10 +23370,10 @@ var esDecorateHelper = {
|
|
|
23366
23370
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23367
23371
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
23368
23372
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
23369
|
-
if (_ = accept(result.init)) initializers.
|
|
23373
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
23370
23374
|
}
|
|
23371
23375
|
else if (_ = accept(result)) {
|
|
23372
|
-
if (kind === "field") initializers.
|
|
23376
|
+
if (kind === "field") initializers.unshift(_);
|
|
23373
23377
|
else descriptor[key] = _;
|
|
23374
23378
|
}
|
|
23375
23379
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -2304,7 +2304,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2304
2304
|
|
|
2305
2305
|
// src/compiler/corePublic.ts
|
|
2306
2306
|
var versionMajorMinor = "5.2";
|
|
2307
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2307
|
+
var version = `${versionMajorMinor}.0-dev.20230518`;
|
|
2308
2308
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2309
2309
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2310
2310
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -22754,7 +22754,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22754
22754
|
ensureUseStrict,
|
|
22755
22755
|
liftToBlock,
|
|
22756
22756
|
mergeLexicalEnvironment,
|
|
22757
|
-
updateModifiers
|
|
22757
|
+
updateModifiers,
|
|
22758
|
+
updateModifierLike
|
|
22758
22759
|
};
|
|
22759
22760
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
22760
22761
|
return factory2;
|
|
@@ -26236,6 +26237,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26236
26237
|
}
|
|
26237
26238
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
26238
26239
|
}
|
|
26240
|
+
function updateModifierLike(node, modifierArray) {
|
|
26241
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
26242
|
+
}
|
|
26239
26243
|
function asNodeArray(array) {
|
|
26240
26244
|
return array ? createNodeArray(array) : void 0;
|
|
26241
26245
|
}
|
|
@@ -27617,10 +27621,10 @@ var esDecorateHelper = {
|
|
|
27617
27621
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
27618
27622
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
27619
27623
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
27620
|
-
if (_ = accept(result.init)) initializers.
|
|
27624
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
27621
27625
|
}
|
|
27622
27626
|
else if (_ = accept(result)) {
|
|
27623
|
-
if (kind === "field") initializers.
|
|
27627
|
+
if (kind === "field") initializers.unshift(_);
|
|
27624
27628
|
else descriptor[key] = _;
|
|
27625
27629
|
}
|
|
27626
27630
|
}
|
|
@@ -153173,7 +153177,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
|
|
|
153173
153177
|
false
|
|
153174
153178
|
);
|
|
153175
153179
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
153176
|
-
let modifierFlags = effectiveModifierFlags &
|
|
153180
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
153181
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
153177
153182
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
153178
153183
|
modifierFlags |= 128 /* Accessor */;
|
|
153179
153184
|
}
|
|
@@ -155745,6 +155750,7 @@ function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
|
155745
155750
|
}
|
|
155746
155751
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
155747
155752
|
let insertText;
|
|
155753
|
+
let filterText;
|
|
155748
155754
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
155749
155755
|
let data;
|
|
155750
155756
|
let isSnippet;
|
|
@@ -155803,11 +155809,15 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
155803
155809
|
}
|
|
155804
155810
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
155805
155811
|
let importAdder;
|
|
155806
|
-
|
|
155807
|
-
|
|
155808
|
-
|
|
155809
|
-
|
|
155810
|
-
|
|
155812
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
155813
|
+
if (memberCompletionEntry) {
|
|
155814
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
155815
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
155816
|
+
hasAction = true;
|
|
155817
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
155818
|
+
}
|
|
155819
|
+
} else {
|
|
155820
|
+
return void 0;
|
|
155811
155821
|
}
|
|
155812
155822
|
}
|
|
155813
155823
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -155851,6 +155861,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
155851
155861
|
hasAction: hasAction ? true : void 0,
|
|
155852
155862
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
155853
155863
|
insertText,
|
|
155864
|
+
filterText,
|
|
155854
155865
|
replacementSpan,
|
|
155855
155866
|
sourceDisplay,
|
|
155856
155867
|
labelDetails,
|
|
@@ -155871,11 +155882,11 @@ function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
|
155871
155882
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
155872
155883
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
155873
155884
|
if (!classLikeDeclaration) {
|
|
155874
|
-
return
|
|
155885
|
+
return void 0;
|
|
155875
155886
|
}
|
|
155876
155887
|
let isSnippet;
|
|
155877
|
-
let replacementSpan;
|
|
155878
155888
|
let insertText = name;
|
|
155889
|
+
const filterText = name;
|
|
155879
155890
|
const checker = program.getTypeChecker();
|
|
155880
155891
|
const sourceFile = location.getSourceFile();
|
|
155881
155892
|
const printer = createSnippetPrinter({
|
|
@@ -155904,9 +155915,9 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
155904
155915
|
);
|
|
155905
155916
|
}
|
|
155906
155917
|
let modifiers = 0 /* None */;
|
|
155907
|
-
const { modifiers: presentModifiers,
|
|
155908
|
-
const isAbstract =
|
|
155909
|
-
|
|
155918
|
+
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
155919
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
155920
|
+
let completionNodes = [];
|
|
155910
155921
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
155911
155922
|
symbol,
|
|
155912
155923
|
classLikeDeclaration,
|
|
@@ -155930,18 +155941,42 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
155930
155941
|
requiredModifiers |= 16384 /* Override */;
|
|
155931
155942
|
}
|
|
155932
155943
|
if (!completionNodes.length) {
|
|
155933
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
155944
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
155934
155945
|
}
|
|
155935
155946
|
node = factory.updateModifiers(node, modifiers);
|
|
155936
155947
|
completionNodes.push(node);
|
|
155937
155948
|
},
|
|
155938
155949
|
body,
|
|
155939
155950
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
155940
|
-
isAbstract
|
|
155951
|
+
!!isAbstract
|
|
155941
155952
|
);
|
|
155942
155953
|
if (completionNodes.length) {
|
|
155954
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
155955
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
155956
|
+
if (!isMethod) {
|
|
155957
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
155958
|
+
} else {
|
|
155959
|
+
allowedModifiers |= 512 /* Async */;
|
|
155960
|
+
}
|
|
155961
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
155962
|
+
if (presentModifiers & ~allowedModifiers) {
|
|
155963
|
+
return void 0;
|
|
155964
|
+
}
|
|
155965
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
155966
|
+
modifiers &= ~16 /* Protected */;
|
|
155967
|
+
}
|
|
155968
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
155969
|
+
modifiers &= ~4 /* Public */;
|
|
155970
|
+
}
|
|
155971
|
+
modifiers |= allowedAndPresent;
|
|
155972
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
155973
|
+
if (presentDecorators == null ? void 0 : presentDecorators.length) {
|
|
155974
|
+
const lastNode = completionNodes[completionNodes.length - 1];
|
|
155975
|
+
if (canHaveDecorators(lastNode)) {
|
|
155976
|
+
completionNodes[completionNodes.length - 1] = factory.updateModifierLike(lastNode, presentDecorators.concat(getModifiers(lastNode) || []));
|
|
155977
|
+
}
|
|
155978
|
+
}
|
|
155943
155979
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
155944
|
-
replacementSpan = modifiersSpan;
|
|
155945
155980
|
if (formatContext) {
|
|
155946
155981
|
insertText = printer.printAndFormatSnippetList(
|
|
155947
155982
|
format,
|
|
@@ -155957,24 +155992,29 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
155957
155992
|
);
|
|
155958
155993
|
}
|
|
155959
155994
|
}
|
|
155960
|
-
return { insertText, isSnippet, importAdder,
|
|
155995
|
+
return { insertText, filterText, isSnippet, importAdder, eraseRange };
|
|
155961
155996
|
}
|
|
155962
155997
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
155963
155998
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
155964
155999
|
return { modifiers: 0 /* None */ };
|
|
155965
156000
|
}
|
|
155966
156001
|
let modifiers = 0 /* None */;
|
|
155967
|
-
let
|
|
156002
|
+
let decorators;
|
|
155968
156003
|
let contextMod;
|
|
155969
|
-
|
|
155970
|
-
|
|
155971
|
-
span = createTextSpanFromNode(contextToken);
|
|
155972
|
-
}
|
|
155973
|
-
if (isPropertyDeclaration(contextToken.parent)) {
|
|
156004
|
+
const range = { pos: position, end: position };
|
|
156005
|
+
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
155974
156006
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
155975
|
-
|
|
156007
|
+
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
156008
|
+
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
155976
156009
|
}
|
|
155977
|
-
|
|
156010
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
156011
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
156012
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
156013
|
+
modifiers |= contextModifierFlag;
|
|
156014
|
+
range.pos = Math.min(range.pos, contextToken.pos);
|
|
156015
|
+
}
|
|
156016
|
+
}
|
|
156017
|
+
return { modifiers, decorators, range: range.pos !== position ? range : void 0 };
|
|
155978
156018
|
}
|
|
155979
156019
|
function isModifierLike2(node) {
|
|
155980
156020
|
if (isModifier(node)) {
|
|
@@ -156597,7 +156637,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
156597
156637
|
}
|
|
156598
156638
|
}
|
|
156599
156639
|
if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) {
|
|
156600
|
-
const { importAdder } = getEntryForMemberCompletion(
|
|
156640
|
+
const { importAdder, eraseRange } = getEntryForMemberCompletion(
|
|
156601
156641
|
host,
|
|
156602
156642
|
program,
|
|
156603
156643
|
compilerOptions,
|
|
@@ -156609,10 +156649,17 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
156609
156649
|
contextToken,
|
|
156610
156650
|
formatContext
|
|
156611
156651
|
);
|
|
156612
|
-
if (importAdder) {
|
|
156652
|
+
if (importAdder || eraseRange) {
|
|
156613
156653
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
156614
156654
|
{ host, formatContext, preferences },
|
|
156615
|
-
|
|
156655
|
+
(tracker) => {
|
|
156656
|
+
if (importAdder) {
|
|
156657
|
+
importAdder.writeFixes(tracker);
|
|
156658
|
+
}
|
|
156659
|
+
if (eraseRange) {
|
|
156660
|
+
tracker.deleteRange(sourceFile, eraseRange);
|
|
156661
|
+
}
|
|
156662
|
+
}
|
|
156616
156663
|
);
|
|
156617
156664
|
return {
|
|
156618
156665
|
sourceDisplay: void 0,
|
|
@@ -181679,6 +181726,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
181679
181726
|
kindModifiers,
|
|
181680
181727
|
sortText,
|
|
181681
181728
|
insertText,
|
|
181729
|
+
filterText,
|
|
181682
181730
|
replacementSpan,
|
|
181683
181731
|
hasAction,
|
|
181684
181732
|
source,
|
|
@@ -181697,6 +181745,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
181697
181745
|
kindModifiers,
|
|
181698
181746
|
sortText,
|
|
181699
181747
|
insertText,
|
|
181748
|
+
filterText,
|
|
181700
181749
|
replacementSpan: convertedSpan,
|
|
181701
181750
|
isSnippet,
|
|
181702
181751
|
hasAction: hasAction || void 0,
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -1829,6 +1829,11 @@ declare namespace ts {
|
|
|
1829
1829
|
* coupled with `replacementSpan` to replace a dotted access with a bracket access.
|
|
1830
1830
|
*/
|
|
1831
1831
|
insertText?: string;
|
|
1832
|
+
/**
|
|
1833
|
+
* A string that should be used when filtering a set of
|
|
1834
|
+
* completion items.
|
|
1835
|
+
*/
|
|
1836
|
+
filterText?: string;
|
|
1832
1837
|
/**
|
|
1833
1838
|
* `insertText` should be interpreted as a snippet if true.
|
|
1834
1839
|
*/
|
|
@@ -10801,6 +10806,7 @@ declare namespace ts {
|
|
|
10801
10806
|
kindModifiers?: string;
|
|
10802
10807
|
sortText: string;
|
|
10803
10808
|
insertText?: string;
|
|
10809
|
+
filterText?: string;
|
|
10804
10810
|
isSnippet?: true;
|
|
10805
10811
|
/**
|
|
10806
10812
|
* An optional span that indicates the text to be replaced by this completion item.
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230518`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -20592,7 +20592,8 @@ ${lanes.join("\n")}
|
|
|
20592
20592
|
ensureUseStrict,
|
|
20593
20593
|
liftToBlock,
|
|
20594
20594
|
mergeLexicalEnvironment,
|
|
20595
|
-
updateModifiers
|
|
20595
|
+
updateModifiers,
|
|
20596
|
+
updateModifierLike
|
|
20596
20597
|
};
|
|
20597
20598
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
20598
20599
|
return factory2;
|
|
@@ -24074,6 +24075,9 @@ ${lanes.join("\n")}
|
|
|
24074
24075
|
}
|
|
24075
24076
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
24076
24077
|
}
|
|
24078
|
+
function updateModifierLike(node, modifierArray) {
|
|
24079
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
24080
|
+
}
|
|
24077
24081
|
function asNodeArray(array) {
|
|
24078
24082
|
return array ? createNodeArray(array) : void 0;
|
|
24079
24083
|
}
|
|
@@ -25516,10 +25520,10 @@ ${lanes.join("\n")}
|
|
|
25516
25520
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
25517
25521
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
25518
25522
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
25519
|
-
if (_ = accept(result.init)) initializers.
|
|
25523
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
25520
25524
|
}
|
|
25521
25525
|
else if (_ = accept(result)) {
|
|
25522
|
-
if (kind === "field") initializers.
|
|
25526
|
+
if (kind === "field") initializers.unshift(_);
|
|
25523
25527
|
else descriptor[key] = _;
|
|
25524
25528
|
}
|
|
25525
25529
|
}
|
|
@@ -152220,7 +152224,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
152220
152224
|
false
|
|
152221
152225
|
);
|
|
152222
152226
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
152223
|
-
let modifierFlags = effectiveModifierFlags &
|
|
152227
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
152228
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
152224
152229
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
152225
152230
|
modifierFlags |= 128 /* Accessor */;
|
|
152226
152231
|
}
|
|
@@ -154977,6 +154982,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
154977
154982
|
}
|
|
154978
154983
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
154979
154984
|
let insertText;
|
|
154985
|
+
let filterText;
|
|
154980
154986
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
154981
154987
|
let data;
|
|
154982
154988
|
let isSnippet;
|
|
@@ -155035,11 +155041,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155035
155041
|
}
|
|
155036
155042
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
155037
155043
|
let importAdder;
|
|
155038
|
-
|
|
155039
|
-
|
|
155040
|
-
|
|
155041
|
-
|
|
155042
|
-
|
|
155044
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
155045
|
+
if (memberCompletionEntry) {
|
|
155046
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
155047
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
155048
|
+
hasAction = true;
|
|
155049
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
155050
|
+
}
|
|
155051
|
+
} else {
|
|
155052
|
+
return void 0;
|
|
155043
155053
|
}
|
|
155044
155054
|
}
|
|
155045
155055
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -155083,6 +155093,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155083
155093
|
hasAction: hasAction ? true : void 0,
|
|
155084
155094
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
155085
155095
|
insertText,
|
|
155096
|
+
filterText,
|
|
155086
155097
|
replacementSpan,
|
|
155087
155098
|
sourceDisplay,
|
|
155088
155099
|
labelDetails,
|
|
@@ -155103,11 +155114,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155103
155114
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
155104
155115
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
155105
155116
|
if (!classLikeDeclaration) {
|
|
155106
|
-
return
|
|
155117
|
+
return void 0;
|
|
155107
155118
|
}
|
|
155108
155119
|
let isSnippet;
|
|
155109
|
-
let replacementSpan;
|
|
155110
155120
|
let insertText = name;
|
|
155121
|
+
const filterText = name;
|
|
155111
155122
|
const checker = program.getTypeChecker();
|
|
155112
155123
|
const sourceFile = location.getSourceFile();
|
|
155113
155124
|
const printer = createSnippetPrinter({
|
|
@@ -155136,9 +155147,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155136
155147
|
);
|
|
155137
155148
|
}
|
|
155138
155149
|
let modifiers = 0 /* None */;
|
|
155139
|
-
const { modifiers: presentModifiers,
|
|
155140
|
-
const isAbstract =
|
|
155141
|
-
|
|
155150
|
+
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
155151
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
155152
|
+
let completionNodes = [];
|
|
155142
155153
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
155143
155154
|
symbol,
|
|
155144
155155
|
classLikeDeclaration,
|
|
@@ -155162,18 +155173,42 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155162
155173
|
requiredModifiers |= 16384 /* Override */;
|
|
155163
155174
|
}
|
|
155164
155175
|
if (!completionNodes.length) {
|
|
155165
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
155176
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
155166
155177
|
}
|
|
155167
155178
|
node = factory.updateModifiers(node, modifiers);
|
|
155168
155179
|
completionNodes.push(node);
|
|
155169
155180
|
},
|
|
155170
155181
|
body,
|
|
155171
155182
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
155172
|
-
isAbstract
|
|
155183
|
+
!!isAbstract
|
|
155173
155184
|
);
|
|
155174
155185
|
if (completionNodes.length) {
|
|
155186
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
155187
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
155188
|
+
if (!isMethod) {
|
|
155189
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
155190
|
+
} else {
|
|
155191
|
+
allowedModifiers |= 512 /* Async */;
|
|
155192
|
+
}
|
|
155193
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
155194
|
+
if (presentModifiers & ~allowedModifiers) {
|
|
155195
|
+
return void 0;
|
|
155196
|
+
}
|
|
155197
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
155198
|
+
modifiers &= ~16 /* Protected */;
|
|
155199
|
+
}
|
|
155200
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
155201
|
+
modifiers &= ~4 /* Public */;
|
|
155202
|
+
}
|
|
155203
|
+
modifiers |= allowedAndPresent;
|
|
155204
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
155205
|
+
if (presentDecorators == null ? void 0 : presentDecorators.length) {
|
|
155206
|
+
const lastNode = completionNodes[completionNodes.length - 1];
|
|
155207
|
+
if (canHaveDecorators(lastNode)) {
|
|
155208
|
+
completionNodes[completionNodes.length - 1] = factory.updateModifierLike(lastNode, presentDecorators.concat(getModifiers(lastNode) || []));
|
|
155209
|
+
}
|
|
155210
|
+
}
|
|
155175
155211
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
155176
|
-
replacementSpan = modifiersSpan;
|
|
155177
155212
|
if (formatContext) {
|
|
155178
155213
|
insertText = printer.printAndFormatSnippetList(
|
|
155179
155214
|
format,
|
|
@@ -155189,24 +155224,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155189
155224
|
);
|
|
155190
155225
|
}
|
|
155191
155226
|
}
|
|
155192
|
-
return { insertText, isSnippet, importAdder,
|
|
155227
|
+
return { insertText, filterText, isSnippet, importAdder, eraseRange };
|
|
155193
155228
|
}
|
|
155194
155229
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
155195
155230
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
155196
155231
|
return { modifiers: 0 /* None */ };
|
|
155197
155232
|
}
|
|
155198
155233
|
let modifiers = 0 /* None */;
|
|
155199
|
-
let
|
|
155234
|
+
let decorators;
|
|
155200
155235
|
let contextMod;
|
|
155201
|
-
|
|
155202
|
-
|
|
155203
|
-
span = createTextSpanFromNode(contextToken);
|
|
155204
|
-
}
|
|
155205
|
-
if (isPropertyDeclaration(contextToken.parent)) {
|
|
155236
|
+
const range = { pos: position, end: position };
|
|
155237
|
+
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
155206
155238
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
155207
|
-
|
|
155239
|
+
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
155240
|
+
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
155208
155241
|
}
|
|
155209
|
-
|
|
155242
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
155243
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
155244
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
155245
|
+
modifiers |= contextModifierFlag;
|
|
155246
|
+
range.pos = Math.min(range.pos, contextToken.pos);
|
|
155247
|
+
}
|
|
155248
|
+
}
|
|
155249
|
+
return { modifiers, decorators, range: range.pos !== position ? range : void 0 };
|
|
155210
155250
|
}
|
|
155211
155251
|
function isModifierLike2(node) {
|
|
155212
155252
|
if (isModifier(node)) {
|
|
@@ -155829,7 +155869,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155829
155869
|
}
|
|
155830
155870
|
}
|
|
155831
155871
|
if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) {
|
|
155832
|
-
const { importAdder } = getEntryForMemberCompletion(
|
|
155872
|
+
const { importAdder, eraseRange } = getEntryForMemberCompletion(
|
|
155833
155873
|
host,
|
|
155834
155874
|
program,
|
|
155835
155875
|
compilerOptions,
|
|
@@ -155841,10 +155881,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155841
155881
|
contextToken,
|
|
155842
155882
|
formatContext
|
|
155843
155883
|
);
|
|
155844
|
-
if (importAdder) {
|
|
155884
|
+
if (importAdder || eraseRange) {
|
|
155845
155885
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
155846
155886
|
{ host, formatContext, preferences },
|
|
155847
|
-
|
|
155887
|
+
(tracker) => {
|
|
155888
|
+
if (importAdder) {
|
|
155889
|
+
importAdder.writeFixes(tracker);
|
|
155890
|
+
}
|
|
155891
|
+
if (eraseRange) {
|
|
155892
|
+
tracker.deleteRange(sourceFile, eraseRange);
|
|
155893
|
+
}
|
|
155894
|
+
}
|
|
155848
155895
|
);
|
|
155849
155896
|
return {
|
|
155850
155897
|
sourceDisplay: void 0,
|
|
@@ -179117,6 +179164,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
179117
179164
|
kindModifiers,
|
|
179118
179165
|
sortText,
|
|
179119
179166
|
insertText,
|
|
179167
|
+
filterText,
|
|
179120
179168
|
replacementSpan,
|
|
179121
179169
|
hasAction,
|
|
179122
179170
|
source,
|
|
@@ -179135,6 +179183,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
179135
179183
|
kindModifiers,
|
|
179136
179184
|
sortText,
|
|
179137
179185
|
insertText,
|
|
179186
|
+
filterText,
|
|
179138
179187
|
replacementSpan: convertedSpan,
|
|
179139
179188
|
isSnippet,
|
|
179140
179189
|
hasAction: hasAction || void 0,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6838,6 +6838,7 @@ declare namespace ts {
|
|
|
6838
6838
|
kindModifiers?: string;
|
|
6839
6839
|
sortText: string;
|
|
6840
6840
|
insertText?: string;
|
|
6841
|
+
filterText?: string;
|
|
6841
6842
|
isSnippet?: true;
|
|
6842
6843
|
/**
|
|
6843
6844
|
* An optional span that indicates the text to be replaced by this completion item.
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230518`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -20592,7 +20592,8 @@ ${lanes.join("\n")}
|
|
|
20592
20592
|
ensureUseStrict,
|
|
20593
20593
|
liftToBlock,
|
|
20594
20594
|
mergeLexicalEnvironment,
|
|
20595
|
-
updateModifiers
|
|
20595
|
+
updateModifiers,
|
|
20596
|
+
updateModifierLike
|
|
20596
20597
|
};
|
|
20597
20598
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
20598
20599
|
return factory2;
|
|
@@ -24074,6 +24075,9 @@ ${lanes.join("\n")}
|
|
|
24074
24075
|
}
|
|
24075
24076
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
24076
24077
|
}
|
|
24078
|
+
function updateModifierLike(node, modifierArray) {
|
|
24079
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
24080
|
+
}
|
|
24077
24081
|
function asNodeArray(array) {
|
|
24078
24082
|
return array ? createNodeArray(array) : void 0;
|
|
24079
24083
|
}
|
|
@@ -25516,10 +25520,10 @@ ${lanes.join("\n")}
|
|
|
25516
25520
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
25517
25521
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
25518
25522
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
25519
|
-
if (_ = accept(result.init)) initializers.
|
|
25523
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
25520
25524
|
}
|
|
25521
25525
|
else if (_ = accept(result)) {
|
|
25522
|
-
if (kind === "field") initializers.
|
|
25526
|
+
if (kind === "field") initializers.unshift(_);
|
|
25523
25527
|
else descriptor[key] = _;
|
|
25524
25528
|
}
|
|
25525
25529
|
}
|
|
@@ -152235,7 +152239,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
152235
152239
|
false
|
|
152236
152240
|
);
|
|
152237
152241
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
152238
|
-
let modifierFlags = effectiveModifierFlags &
|
|
152242
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
152243
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
152239
152244
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
152240
152245
|
modifierFlags |= 128 /* Accessor */;
|
|
152241
152246
|
}
|
|
@@ -154992,6 +154997,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
154992
154997
|
}
|
|
154993
154998
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
154994
154999
|
let insertText;
|
|
155000
|
+
let filterText;
|
|
154995
155001
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
154996
155002
|
let data;
|
|
154997
155003
|
let isSnippet;
|
|
@@ -155050,11 +155056,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155050
155056
|
}
|
|
155051
155057
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
155052
155058
|
let importAdder;
|
|
155053
|
-
|
|
155054
|
-
|
|
155055
|
-
|
|
155056
|
-
|
|
155057
|
-
|
|
155059
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
155060
|
+
if (memberCompletionEntry) {
|
|
155061
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
155062
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
155063
|
+
hasAction = true;
|
|
155064
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
155065
|
+
}
|
|
155066
|
+
} else {
|
|
155067
|
+
return void 0;
|
|
155058
155068
|
}
|
|
155059
155069
|
}
|
|
155060
155070
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -155098,6 +155108,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155098
155108
|
hasAction: hasAction ? true : void 0,
|
|
155099
155109
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
155100
155110
|
insertText,
|
|
155111
|
+
filterText,
|
|
155101
155112
|
replacementSpan,
|
|
155102
155113
|
sourceDisplay,
|
|
155103
155114
|
labelDetails,
|
|
@@ -155118,11 +155129,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155118
155129
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
155119
155130
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
155120
155131
|
if (!classLikeDeclaration) {
|
|
155121
|
-
return
|
|
155132
|
+
return void 0;
|
|
155122
155133
|
}
|
|
155123
155134
|
let isSnippet;
|
|
155124
|
-
let replacementSpan;
|
|
155125
155135
|
let insertText = name;
|
|
155136
|
+
const filterText = name;
|
|
155126
155137
|
const checker = program.getTypeChecker();
|
|
155127
155138
|
const sourceFile = location.getSourceFile();
|
|
155128
155139
|
const printer = createSnippetPrinter({
|
|
@@ -155151,9 +155162,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155151
155162
|
);
|
|
155152
155163
|
}
|
|
155153
155164
|
let modifiers = 0 /* None */;
|
|
155154
|
-
const { modifiers: presentModifiers,
|
|
155155
|
-
const isAbstract =
|
|
155156
|
-
|
|
155165
|
+
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
155166
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
155167
|
+
let completionNodes = [];
|
|
155157
155168
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
155158
155169
|
symbol,
|
|
155159
155170
|
classLikeDeclaration,
|
|
@@ -155177,18 +155188,42 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155177
155188
|
requiredModifiers |= 16384 /* Override */;
|
|
155178
155189
|
}
|
|
155179
155190
|
if (!completionNodes.length) {
|
|
155180
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
155191
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
155181
155192
|
}
|
|
155182
155193
|
node = factory.updateModifiers(node, modifiers);
|
|
155183
155194
|
completionNodes.push(node);
|
|
155184
155195
|
},
|
|
155185
155196
|
body,
|
|
155186
155197
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
155187
|
-
isAbstract
|
|
155198
|
+
!!isAbstract
|
|
155188
155199
|
);
|
|
155189
155200
|
if (completionNodes.length) {
|
|
155201
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
155202
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
155203
|
+
if (!isMethod) {
|
|
155204
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
155205
|
+
} else {
|
|
155206
|
+
allowedModifiers |= 512 /* Async */;
|
|
155207
|
+
}
|
|
155208
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
155209
|
+
if (presentModifiers & ~allowedModifiers) {
|
|
155210
|
+
return void 0;
|
|
155211
|
+
}
|
|
155212
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
155213
|
+
modifiers &= ~16 /* Protected */;
|
|
155214
|
+
}
|
|
155215
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
155216
|
+
modifiers &= ~4 /* Public */;
|
|
155217
|
+
}
|
|
155218
|
+
modifiers |= allowedAndPresent;
|
|
155219
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
155220
|
+
if (presentDecorators == null ? void 0 : presentDecorators.length) {
|
|
155221
|
+
const lastNode = completionNodes[completionNodes.length - 1];
|
|
155222
|
+
if (canHaveDecorators(lastNode)) {
|
|
155223
|
+
completionNodes[completionNodes.length - 1] = factory.updateModifierLike(lastNode, presentDecorators.concat(getModifiers(lastNode) || []));
|
|
155224
|
+
}
|
|
155225
|
+
}
|
|
155190
155226
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
155191
|
-
replacementSpan = modifiersSpan;
|
|
155192
155227
|
if (formatContext) {
|
|
155193
155228
|
insertText = printer.printAndFormatSnippetList(
|
|
155194
155229
|
format,
|
|
@@ -155204,24 +155239,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155204
155239
|
);
|
|
155205
155240
|
}
|
|
155206
155241
|
}
|
|
155207
|
-
return { insertText, isSnippet, importAdder,
|
|
155242
|
+
return { insertText, filterText, isSnippet, importAdder, eraseRange };
|
|
155208
155243
|
}
|
|
155209
155244
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
155210
155245
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
155211
155246
|
return { modifiers: 0 /* None */ };
|
|
155212
155247
|
}
|
|
155213
155248
|
let modifiers = 0 /* None */;
|
|
155214
|
-
let
|
|
155249
|
+
let decorators;
|
|
155215
155250
|
let contextMod;
|
|
155216
|
-
|
|
155217
|
-
|
|
155218
|
-
span = createTextSpanFromNode(contextToken);
|
|
155219
|
-
}
|
|
155220
|
-
if (isPropertyDeclaration(contextToken.parent)) {
|
|
155251
|
+
const range = { pos: position, end: position };
|
|
155252
|
+
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
155221
155253
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
155222
|
-
|
|
155254
|
+
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
155255
|
+
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
155223
155256
|
}
|
|
155224
|
-
|
|
155257
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
155258
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
155259
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
155260
|
+
modifiers |= contextModifierFlag;
|
|
155261
|
+
range.pos = Math.min(range.pos, contextToken.pos);
|
|
155262
|
+
}
|
|
155263
|
+
}
|
|
155264
|
+
return { modifiers, decorators, range: range.pos !== position ? range : void 0 };
|
|
155225
155265
|
}
|
|
155226
155266
|
function isModifierLike2(node) {
|
|
155227
155267
|
if (isModifier(node)) {
|
|
@@ -155844,7 +155884,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155844
155884
|
}
|
|
155845
155885
|
}
|
|
155846
155886
|
if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) {
|
|
155847
|
-
const { importAdder } = getEntryForMemberCompletion(
|
|
155887
|
+
const { importAdder, eraseRange } = getEntryForMemberCompletion(
|
|
155848
155888
|
host,
|
|
155849
155889
|
program,
|
|
155850
155890
|
compilerOptions,
|
|
@@ -155856,10 +155896,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155856
155896
|
contextToken,
|
|
155857
155897
|
formatContext
|
|
155858
155898
|
);
|
|
155859
|
-
if (importAdder) {
|
|
155899
|
+
if (importAdder || eraseRange) {
|
|
155860
155900
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
155861
155901
|
{ host, formatContext, preferences },
|
|
155862
|
-
|
|
155902
|
+
(tracker) => {
|
|
155903
|
+
if (importAdder) {
|
|
155904
|
+
importAdder.writeFixes(tracker);
|
|
155905
|
+
}
|
|
155906
|
+
if (eraseRange) {
|
|
155907
|
+
tracker.deleteRange(sourceFile, eraseRange);
|
|
155908
|
+
}
|
|
155909
|
+
}
|
|
155863
155910
|
);
|
|
155864
155911
|
return {
|
|
155865
155912
|
sourceDisplay: void 0,
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.2";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230518`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -12891,7 +12891,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12891
12891
|
ensureUseStrict,
|
|
12892
12892
|
liftToBlock,
|
|
12893
12893
|
mergeLexicalEnvironment,
|
|
12894
|
-
updateModifiers
|
|
12894
|
+
updateModifiers,
|
|
12895
|
+
updateModifierLike
|
|
12895
12896
|
};
|
|
12896
12897
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
12897
12898
|
return factory2;
|
|
@@ -16373,6 +16374,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
16373
16374
|
}
|
|
16374
16375
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
16375
16376
|
}
|
|
16377
|
+
function updateModifierLike(node, modifierArray) {
|
|
16378
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
16379
|
+
}
|
|
16376
16380
|
function asNodeArray(array) {
|
|
16377
16381
|
return array ? createNodeArray(array) : void 0;
|
|
16378
16382
|
}
|
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": "5.2.0-dev.
|
|
5
|
+
"version": "5.2.0-dev.20230518",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "20.1.0",
|
|
114
114
|
"npm": "8.19.4"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "174599c5542c38ee8f1fc61c9ca6532b68cbb19c"
|
|
117
117
|
}
|