typescript 5.1.0-dev.20230419 → 5.1.0-dev.20230420
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 +1 -1
- package/lib/tsserver.js +6 -6
- package/lib/tsserverlibrary.d.ts +25 -1
- package/lib/tsserverlibrary.js +6 -6
- package/lib/typescript.d.ts +12 -1
- package/lib/typescript.js +6 -6
- package/lib/typingsInstaller.js +1 -1
- 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.1";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230420`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
package/lib/tsserver.js
CHANGED
|
@@ -2301,7 +2301,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2301
2301
|
|
|
2302
2302
|
// src/compiler/corePublic.ts
|
|
2303
2303
|
var versionMajorMinor = "5.1";
|
|
2304
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2304
|
+
var version = `${versionMajorMinor}.0-dev.20230420`;
|
|
2305
2305
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2306
2306
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2307
2307
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -137081,10 +137081,10 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
137081
137081
|
function getSmartSelectionRange2(fileName, position) {
|
|
137082
137082
|
return ts_SmartSelectionRange_exports.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName));
|
|
137083
137083
|
}
|
|
137084
|
-
function getApplicableRefactors2(fileName, positionOrRange, preferences = emptyOptions, triggerReason, kind) {
|
|
137084
|
+
function getApplicableRefactors2(fileName, positionOrRange, preferences = emptyOptions, triggerReason, kind, includeInteractiveActions) {
|
|
137085
137085
|
synchronizeHostData();
|
|
137086
137086
|
const file = getValidSourceFile(fileName);
|
|
137087
|
-
return ts_refactor_exports.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason, kind));
|
|
137087
|
+
return ts_refactor_exports.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason, kind), includeInteractiveActions);
|
|
137088
137088
|
}
|
|
137089
137089
|
function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName13, actionName2, preferences = emptyOptions) {
|
|
137090
137090
|
synchronizeHostData();
|
|
@@ -152168,7 +152168,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
152168
152168
|
return true;
|
|
152169
152169
|
}
|
|
152170
152170
|
}
|
|
152171
|
-
return isDeclarationName(contextToken2) && !isShorthandPropertyAssignment(contextToken2.parent) && !isJsxAttribute(contextToken2.parent) && !((isClassLike(contextToken2.parent) || isInterfaceDeclaration(contextToken2.parent)) && (contextToken2 !== previousToken || position > previousToken.end));
|
|
152171
|
+
return isDeclarationName(contextToken2) && !isShorthandPropertyAssignment(contextToken2.parent) && !isJsxAttribute(contextToken2.parent) && !((isClassLike(contextToken2.parent) || isInterfaceDeclaration(contextToken2.parent) || isTypeParameterDeclaration(contextToken2.parent)) && (contextToken2 !== previousToken || position > previousToken.end));
|
|
152172
152172
|
}
|
|
152173
152173
|
function isPreviousPropertyDeclarationTerminated(contextToken2, position2) {
|
|
152174
152174
|
return contextToken2.kind !== 64 /* EqualsToken */ && (contextToken2.kind === 27 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile));
|
|
@@ -158359,10 +158359,10 @@ var refactors = /* @__PURE__ */ new Map();
|
|
|
158359
158359
|
function registerRefactor(name, refactor) {
|
|
158360
158360
|
refactors.set(name, refactor);
|
|
158361
158361
|
}
|
|
158362
|
-
function getApplicableRefactors(context) {
|
|
158362
|
+
function getApplicableRefactors(context, includeInteractiveActions) {
|
|
158363
158363
|
return arrayFrom(flatMapIterator(refactors.values(), (refactor) => {
|
|
158364
158364
|
var _a;
|
|
158365
|
-
return context.cancellationToken && context.cancellationToken.isCancellationRequested() || !((_a = refactor.kinds) == null ? void 0 : _a.some((kind) => refactorKindBeginsWith(kind, context.kind))) ? void 0 : refactor.getAvailableActions(context);
|
|
158365
|
+
return context.cancellationToken && context.cancellationToken.isCancellationRequested() || !((_a = refactor.kinds) == null ? void 0 : _a.some((kind) => refactorKindBeginsWith(kind, context.kind))) ? void 0 : refactor.getAvailableActions(context, includeInteractiveActions);
|
|
158366
158366
|
}));
|
|
158367
158367
|
}
|
|
158368
158368
|
function getEditsForRefactor(context, refactorName13, actionName2) {
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -501,6 +501,14 @@ declare namespace ts {
|
|
|
501
501
|
type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
|
|
502
502
|
triggerReason?: RefactorTriggerReason;
|
|
503
503
|
kind?: string;
|
|
504
|
+
/**
|
|
505
|
+
* Include refactor actions that require additional arguments to be passed when
|
|
506
|
+
* calling 'GetEditsForRefactor'. When true, clients should inspect the
|
|
507
|
+
* `isInteractive` property of each returned `RefactorActionInfo`
|
|
508
|
+
* and ensure they are able to collect the appropriate arguments for any
|
|
509
|
+
* interactive refactor before offering it.
|
|
510
|
+
*/
|
|
511
|
+
includeInteractiveActions?: boolean;
|
|
504
512
|
};
|
|
505
513
|
type RefactorTriggerReason = "implicit" | "invoked";
|
|
506
514
|
/**
|
|
@@ -557,6 +565,11 @@ declare namespace ts {
|
|
|
557
565
|
* The hierarchical dotted name of the refactor action.
|
|
558
566
|
*/
|
|
559
567
|
kind?: string;
|
|
568
|
+
/**
|
|
569
|
+
* Indicates that the action requires additional arguments to be passed
|
|
570
|
+
* when calling 'GetEditsForRefactor'.
|
|
571
|
+
*/
|
|
572
|
+
isInteractive?: boolean;
|
|
560
573
|
}
|
|
561
574
|
interface GetEditsForRefactorRequest extends Request {
|
|
562
575
|
command: CommandTypes.GetEditsForRefactor;
|
|
@@ -10129,7 +10142,13 @@ declare namespace ts {
|
|
|
10129
10142
|
applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
|
|
10130
10143
|
/** @deprecated `fileName` will be ignored */
|
|
10131
10144
|
applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
|
|
10132
|
-
|
|
10145
|
+
/**
|
|
10146
|
+
* @param includeInteractiveActions Include refactor actions that require additional arguments to be
|
|
10147
|
+
* passed when calling `getEditsForRefactor`. When true, clients should inspect the `isInteractive`
|
|
10148
|
+
* property of each returned `RefactorActionInfo` and ensure they are able to collect the appropriate
|
|
10149
|
+
* arguments for any interactive action before offering it.
|
|
10150
|
+
*/
|
|
10151
|
+
getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string, includeInteractiveActions?: boolean): ApplicableRefactorInfo[];
|
|
10133
10152
|
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
|
|
10134
10153
|
organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
|
|
10135
10154
|
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
|
|
@@ -10401,6 +10420,11 @@ declare namespace ts {
|
|
|
10401
10420
|
* The hierarchical dotted name of the refactor action.
|
|
10402
10421
|
*/
|
|
10403
10422
|
kind?: string;
|
|
10423
|
+
/**
|
|
10424
|
+
* Indicates that the action requires additional arguments to be passed
|
|
10425
|
+
* when calling `getEditsForRefactor`.
|
|
10426
|
+
*/
|
|
10427
|
+
isInteractive?: boolean;
|
|
10404
10428
|
}
|
|
10405
10429
|
/**
|
|
10406
10430
|
* A set of edits to make in response to a refactor action, plus an optional
|
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.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230420`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -134834,10 +134834,10 @@ ${lanes.join("\n")}
|
|
|
134834
134834
|
function getSmartSelectionRange2(fileName, position) {
|
|
134835
134835
|
return ts_SmartSelectionRange_exports.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName));
|
|
134836
134836
|
}
|
|
134837
|
-
function getApplicableRefactors2(fileName, positionOrRange, preferences = emptyOptions, triggerReason, kind) {
|
|
134837
|
+
function getApplicableRefactors2(fileName, positionOrRange, preferences = emptyOptions, triggerReason, kind, includeInteractiveActions) {
|
|
134838
134838
|
synchronizeHostData();
|
|
134839
134839
|
const file = getValidSourceFile(fileName);
|
|
134840
|
-
return ts_refactor_exports.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason, kind));
|
|
134840
|
+
return ts_refactor_exports.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason, kind), includeInteractiveActions);
|
|
134841
134841
|
}
|
|
134842
134842
|
function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName13, actionName2, preferences = emptyOptions) {
|
|
134843
134843
|
synchronizeHostData();
|
|
@@ -151199,7 +151199,7 @@ ${lanes.join("\n")}
|
|
|
151199
151199
|
return true;
|
|
151200
151200
|
}
|
|
151201
151201
|
}
|
|
151202
|
-
return isDeclarationName(contextToken2) && !isShorthandPropertyAssignment(contextToken2.parent) && !isJsxAttribute(contextToken2.parent) && !((isClassLike(contextToken2.parent) || isInterfaceDeclaration(contextToken2.parent)) && (contextToken2 !== previousToken || position > previousToken.end));
|
|
151202
|
+
return isDeclarationName(contextToken2) && !isShorthandPropertyAssignment(contextToken2.parent) && !isJsxAttribute(contextToken2.parent) && !((isClassLike(contextToken2.parent) || isInterfaceDeclaration(contextToken2.parent) || isTypeParameterDeclaration(contextToken2.parent)) && (contextToken2 !== previousToken || position > previousToken.end));
|
|
151203
151203
|
}
|
|
151204
151204
|
function isPreviousPropertyDeclarationTerminated(contextToken2, position2) {
|
|
151205
151205
|
return contextToken2.kind !== 64 /* EqualsToken */ && (contextToken2.kind === 27 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile));
|
|
@@ -157557,10 +157557,10 @@ ${lanes.join("\n")}
|
|
|
157557
157557
|
function registerRefactor(name, refactor) {
|
|
157558
157558
|
refactors.set(name, refactor);
|
|
157559
157559
|
}
|
|
157560
|
-
function getApplicableRefactors(context) {
|
|
157560
|
+
function getApplicableRefactors(context, includeInteractiveActions) {
|
|
157561
157561
|
return arrayFrom(flatMapIterator(refactors.values(), (refactor) => {
|
|
157562
157562
|
var _a;
|
|
157563
|
-
return context.cancellationToken && context.cancellationToken.isCancellationRequested() || !((_a = refactor.kinds) == null ? void 0 : _a.some((kind) => refactorKindBeginsWith(kind, context.kind))) ? void 0 : refactor.getAvailableActions(context);
|
|
157563
|
+
return context.cancellationToken && context.cancellationToken.isCancellationRequested() || !((_a = refactor.kinds) == null ? void 0 : _a.some((kind) => refactorKindBeginsWith(kind, context.kind))) ? void 0 : refactor.getAvailableActions(context, includeInteractiveActions);
|
|
157564
157564
|
}));
|
|
157565
157565
|
}
|
|
157566
157566
|
function getEditsForRefactor(context, refactorName13, actionName2) {
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6198,7 +6198,13 @@ declare namespace ts {
|
|
|
6198
6198
|
applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
|
|
6199
6199
|
/** @deprecated `fileName` will be ignored */
|
|
6200
6200
|
applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
|
|
6201
|
-
|
|
6201
|
+
/**
|
|
6202
|
+
* @param includeInteractiveActions Include refactor actions that require additional arguments to be
|
|
6203
|
+
* passed when calling `getEditsForRefactor`. When true, clients should inspect the `isInteractive`
|
|
6204
|
+
* property of each returned `RefactorActionInfo` and ensure they are able to collect the appropriate
|
|
6205
|
+
* arguments for any interactive action before offering it.
|
|
6206
|
+
*/
|
|
6207
|
+
getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string, includeInteractiveActions?: boolean): ApplicableRefactorInfo[];
|
|
6202
6208
|
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
|
|
6203
6209
|
organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
|
|
6204
6210
|
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
|
|
@@ -6470,6 +6476,11 @@ declare namespace ts {
|
|
|
6470
6476
|
* The hierarchical dotted name of the refactor action.
|
|
6471
6477
|
*/
|
|
6472
6478
|
kind?: string;
|
|
6479
|
+
/**
|
|
6480
|
+
* Indicates that the action requires additional arguments to be passed
|
|
6481
|
+
* when calling `getEditsForRefactor`.
|
|
6482
|
+
*/
|
|
6483
|
+
isInteractive?: boolean;
|
|
6473
6484
|
}
|
|
6474
6485
|
/**
|
|
6475
6486
|
* A set of edits to make in response to a refactor action, plus an optional
|
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.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230420`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -134848,10 +134848,10 @@ ${lanes.join("\n")}
|
|
|
134848
134848
|
function getSmartSelectionRange2(fileName, position) {
|
|
134849
134849
|
return ts_SmartSelectionRange_exports.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName));
|
|
134850
134850
|
}
|
|
134851
|
-
function getApplicableRefactors2(fileName, positionOrRange, preferences = emptyOptions, triggerReason, kind) {
|
|
134851
|
+
function getApplicableRefactors2(fileName, positionOrRange, preferences = emptyOptions, triggerReason, kind, includeInteractiveActions) {
|
|
134852
134852
|
synchronizeHostData();
|
|
134853
134853
|
const file = getValidSourceFile(fileName);
|
|
134854
|
-
return ts_refactor_exports.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason, kind));
|
|
134854
|
+
return ts_refactor_exports.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason, kind), includeInteractiveActions);
|
|
134855
134855
|
}
|
|
134856
134856
|
function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName13, actionName2, preferences = emptyOptions) {
|
|
134857
134857
|
synchronizeHostData();
|
|
@@ -151213,7 +151213,7 @@ ${lanes.join("\n")}
|
|
|
151213
151213
|
return true;
|
|
151214
151214
|
}
|
|
151215
151215
|
}
|
|
151216
|
-
return isDeclarationName(contextToken2) && !isShorthandPropertyAssignment(contextToken2.parent) && !isJsxAttribute(contextToken2.parent) && !((isClassLike(contextToken2.parent) || isInterfaceDeclaration(contextToken2.parent)) && (contextToken2 !== previousToken || position > previousToken.end));
|
|
151216
|
+
return isDeclarationName(contextToken2) && !isShorthandPropertyAssignment(contextToken2.parent) && !isJsxAttribute(contextToken2.parent) && !((isClassLike(contextToken2.parent) || isInterfaceDeclaration(contextToken2.parent) || isTypeParameterDeclaration(contextToken2.parent)) && (contextToken2 !== previousToken || position > previousToken.end));
|
|
151217
151217
|
}
|
|
151218
151218
|
function isPreviousPropertyDeclarationTerminated(contextToken2, position2) {
|
|
151219
151219
|
return contextToken2.kind !== 64 /* EqualsToken */ && (contextToken2.kind === 27 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile));
|
|
@@ -157571,10 +157571,10 @@ ${lanes.join("\n")}
|
|
|
157571
157571
|
function registerRefactor(name, refactor) {
|
|
157572
157572
|
refactors.set(name, refactor);
|
|
157573
157573
|
}
|
|
157574
|
-
function getApplicableRefactors(context) {
|
|
157574
|
+
function getApplicableRefactors(context, includeInteractiveActions) {
|
|
157575
157575
|
return arrayFrom(flatMapIterator(refactors.values(), (refactor) => {
|
|
157576
157576
|
var _a;
|
|
157577
|
-
return context.cancellationToken && context.cancellationToken.isCancellationRequested() || !((_a = refactor.kinds) == null ? void 0 : _a.some((kind) => refactorKindBeginsWith(kind, context.kind))) ? void 0 : refactor.getAvailableActions(context);
|
|
157577
|
+
return context.cancellationToken && context.cancellationToken.isCancellationRequested() || !((_a = refactor.kinds) == null ? void 0 : _a.some((kind) => refactorKindBeginsWith(kind, context.kind))) ? void 0 : refactor.getAvailableActions(context, includeInteractiveActions);
|
|
157578
157578
|
}));
|
|
157579
157579
|
}
|
|
157580
157580
|
function getEditsForRefactor(context, refactorName13, actionName2) {
|
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.1";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230420`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
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.1.0-dev.
|
|
5
|
+
"version": "5.1.0-dev.20230420",
|
|
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": "14.21.1",
|
|
114
114
|
"npm": "8.19.3"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "484994735758d34da8e8259d1371c20f8de26a4f"
|
|
117
117
|
}
|