Skip to content

Commit 03540d6

Browse files
authored
Pick up latest TS for building VS code (microsoft#180706)
1 parent 1b6bf15 commit 03540d6

File tree

10 files changed

+42
-64
lines changed

10 files changed

+42
-64
lines changed

build/lib/i18n.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/treeshaking.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/tsb/builder.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/tsb/transpiler.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/tsb/utils.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/typescript-language-features/src/languageFeatures/refactor.ts

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ class MoveToFileRefactorCommand implements Command {
149149
return;
150150
}
151151

152-
const fileSuggestionArgs: Proto.GetEditsForMoveToFileRefactorRequestArgs = {
152+
const fileSuggestionArgs: Proto.GetEditsForRefactorRequestArgs = {
153153
...typeConverters.Range.toFileRangeRequestArgs(file, args.range),
154-
filepath: targetFile,
155154
action: 'Move to file',
156155
refactor: 'Move to file',
156+
interactiveRefactorArguments: { targetFile },
157157
};
158158

159-
const response = await this.client.execute('getEditsForMoveToFileRefactor', fileSuggestionArgs, nulToken);
159+
const response = await this.client.execute('getEditsForRefactor', fileSuggestionArgs, nulToken);
160160
if (response.type !== 'response' || !response.body) {
161161
return;
162162
}
@@ -175,16 +175,18 @@ class MoveToFileRefactorCommand implements Command {
175175
if (response.type !== 'response' || !response.body) {
176176
return;
177177
}
178+
const defaultUri = vscode.Uri.joinPath(Utils.dirname(document.uri), response.body.newFileName);
178179

179-
const selectFileItem: vscode.QuickPickItem = {
180-
label: vscode.l10n.t("Select file..."),
181-
detail: vscode.l10n.t("Select file or enter new file path..."),
180+
const selectExistingFileItem: vscode.QuickPickItem = {
181+
label: vscode.l10n.t("Select existing file..."),
182+
};
183+
const selectNewFileItem: vscode.QuickPickItem = {
184+
label: vscode.l10n.t("Enter new file path..."),
182185
};
183186

184-
type DestinationItem = vscode.QuickPickItem & { file: string };
187+
type DestinationItem = vscode.QuickPickItem & { readonly file: string };
185188

186189
const workspaceFolder = vscode.workspace.getWorkspaceFolder(document.uri);
187-
188190
const destinationItems = response.body.files.map((file): DestinationItem => {
189191
const uri = this.client.toResource(file);
190192
const parentDir = Utils.dirname(uri);
@@ -208,7 +210,8 @@ class MoveToFileRefactorCommand implements Command {
208210
});
209211

210212
const picked = await vscode.window.showQuickPick([
211-
selectFileItem,
213+
selectExistingFileItem,
214+
selectNewFileItem,
212215
{ label: vscode.l10n.t("Destination Files"), kind: vscode.QuickPickItemKind.Separator },
213216
...destinationItems
214217
], {
@@ -219,16 +222,23 @@ class MoveToFileRefactorCommand implements Command {
219222
return;
220223
}
221224

222-
if (picked === selectFileItem) {
225+
if (picked === selectExistingFileItem) {
226+
const picked = await vscode.window.showOpenDialog({
227+
title: vscode.l10n.t("Select move destination"),
228+
openLabel: vscode.l10n.t("Move to File"),
229+
defaultUri
230+
});
231+
return picked?.length ? this.client.toTsFilePath(picked[0]) : undefined;
232+
} else if (picked === selectNewFileItem) {
223233
const picked = await vscode.window.showSaveDialog({
224234
title: vscode.l10n.t("Select move destination"),
225235
saveLabel: vscode.l10n.t("Move to File"),
226-
defaultUri: vscode.Uri.joinPath(Utils.dirname(document.uri), response.body.newFilename)
236+
defaultUri,
227237
});
228238
return picked ? this.client.toTsFilePath(picked) : undefined;
239+
} else {
240+
return (picked as DestinationItem).file;
229241
}
230-
231-
return (picked as DestinationItem).file;
232242
}
233243
}
234244

@@ -467,10 +477,11 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
467477
}
468478
this.formattingOptionsManager.ensureConfigurationForDocument(document, token);
469479

470-
const args: Proto.GetApplicableRefactorsRequestArgs & { kind?: string } = {
480+
const args: Proto.GetApplicableRefactorsRequestArgs = {
471481
...typeConverters.Range.toFileRangeRequestArgs(file, rangeOrSelection),
472482
triggerReason: this.toTsTriggerReason(context),
473-
kind: context.only?.value
483+
kind: context.only?.value,
484+
includeInteractiveActions: true,
474485
};
475486
return this.client.execute('getApplicableRefactors', args, token);
476487
});

extensions/typescript-language-features/src/tsServer/protocol/protocol.d.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,6 @@ declare module 'typescript/lib/tsserverlibrary' {
2020
readonly _serverType?: ServerType;
2121
}
2222

23-
interface GetMoveToRefactoringFileSuggestionsRequest extends Request {
24-
command: 'getMoveToRefactoringFileSuggestions';
25-
arguments: GetMoveToRefactoringFileSuggestionsRequestArgs;
26-
}
27-
28-
type GetMoveToRefactoringFileSuggestionsRequestArgs = FileLocationOrRangeRequestArgs & {
29-
triggerReason?: RefactorTriggerReason;
30-
kind?: string;
31-
};
32-
33-
interface GetMoveToRefactoringFileSuggestionsResponse extends Response {
34-
body?: {
35-
newFilename: string;
36-
files: string[];
37-
};
38-
}
39-
40-
interface GetEditsForMoveToFileRefactorRequest extends Request {
41-
command: 'getEditsForMoveToFileRefactor';
42-
arguments: GetEditsForMoveToFileRefactorRequestArgs;
43-
}
44-
45-
interface GetEditsForMoveToFileRefactorResponse extends Response {
46-
body?: RefactorEditInfo;
47-
}
48-
49-
type GetEditsForMoveToFileRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
50-
refactor: string;
51-
action: string;
52-
filepath: string;
53-
};
54-
5523
interface LinkedEditingRangesBody {
5624
ranges: TextSpan[];
5725
wordPattern?: string;

extensions/typescript-language-features/src/typescriptService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ interface StandardTsServerRequests {
7474
'provideInlayHints': [Proto.InlayHintsRequestArgs, Proto.InlayHintsResponse];
7575
'encodedSemanticClassifications-full': [Proto.EncodedSemanticClassificationsRequestArgs, Proto.EncodedSemanticClassificationsResponse];
7676
'findSourceDefinition': [Proto.FileLocationRequestArgs, Proto.DefinitionResponse];
77-
'getMoveToRefactoringFileSuggestions': [Proto.GetMoveToRefactoringFileSuggestionsRequestArgs, Proto.GetMoveToRefactoringFileSuggestionsResponse];
78-
'getEditsForMoveToFileRefactor': [Proto.GetEditsForMoveToFileRefactorRequestArgs, Proto.GetEditsForMoveToFileRefactorResponse];
77+
'getMoveToRefactoringFileSuggestions': [Proto.GetMoveToRefactoringFileSuggestionsRequestArgs, Proto.GetMoveToRefactoringFileSuggestions];
7978
'linkedEditingRange': [Proto.FileLocationRequestArgs, Proto.LinkedEditingRangeResponse];
8079
}
8180

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
"ts-loader": "^9.4.2",
204204
"ts-node": "^10.9.1",
205205
"tsec": "0.1.4",
206-
"typescript": "^5.1.0-dev.20230417",
206+
"typescript": "^5.1.0-dev.20230424",
207207
"typescript-formatter": "7.1.0",
208208
"underscore": "^1.12.1",
209209
"util": "^0.12.4",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9807,10 +9807,10 @@ typescript@^4.7.4:
98079807
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
98089808
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
98099809

9810-
typescript@^5.1.0-dev.20230417:
9811-
version "5.1.0-dev.20230417"
9812-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.0-dev.20230417.tgz#3c6acdd4e49858bc10f7bdf535e768513ebc55e9"
9813-
integrity sha512-bEjKfPjxAgvrUViweybCkB++3y9qyF4hCBeXOf998QQDJpLAcaQWmub4IoPZ5yTvrkuGuNzFpy46tytA4p1fbA==
9810+
typescript@^5.1.0-dev.20230424:
9811+
version "5.1.0-dev.20230424"
9812+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.0-dev.20230424.tgz#6b560143787fd346682077dbbad5e1135a476870"
9813+
integrity sha512-yhQpzzjyLCyXORVY8AgJYaWpm235ZzG/boelYvgloE7v+kCucAdegsBf7duLJzXc/8+wABR2diYMbjPpd5c3Ww==
98149814

98159815
typical@^4.0.0:
98169816
version "4.0.0"

0 commit comments

Comments
 (0)