Skip to content

Commit 4080745

Browse files
committed
Merge remote-tracking branch 'origin/main' into tyriar/si_integration_tests
2 parents fa1e2af + 362ac63 commit 4080745

File tree

113 files changed

+2290
-1840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2290
-1840
lines changed

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
"[github-issues]": {
169169
"editor.wordWrap": "on"
170170
},
171-
"extensions.experimental.supportWorkspaceExtensions": true,
172171
"css.format.spaceAroundSelectorSeparator": true,
173172
"inlineChat.mode": "live",
174173
"typescript.enablePromptUseWorkspaceTsdk": true,

build/npm/gyp/yarn.lock

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,6 @@ minipass@^3.0.0:
493493
dependencies:
494494
yallist "^4.0.0"
495495

496-
minipass@^4.0.0:
497-
version "4.0.3"
498-
resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.0.3.tgz#00bfbaf1e16e35e804f4aa31a7c1f6b8d9f0ee72"
499-
integrity sha512-OW2r4sQ0sI+z5ckEt5c1Tri4xTgZwYDxpE54eqWlQloQRoWtXjqt9udJ5Z4dSv7wK+nfFI7FRXyCpBSft+gpFw==
500-
501496
minipass@^5.0.0:
502497
version "5.0.0"
503498
resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d"
@@ -743,10 +738,10 @@ strip-ansi@^7.0.1:
743738
dependencies:
744739
ansi-regex "^6.0.1"
745740

746-
tar@^6.1.11:
747-
version "6.1.15"
748-
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.15.tgz#c9738b0b98845a3b344d334b8fa3041aaba53a69"
749-
integrity sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==
741+
tar@^6.1.11, tar@^6.1.2:
742+
version "6.2.1"
743+
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
744+
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
750745
dependencies:
751746
chownr "^2.0.0"
752747
fs-minipass "^2.0.0"
@@ -755,18 +750,6 @@ tar@^6.1.11:
755750
mkdirp "^1.0.3"
756751
yallist "^4.0.0"
757752

758-
tar@^6.1.2:
759-
version "6.1.13"
760-
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b"
761-
integrity sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==
762-
dependencies:
763-
chownr "^2.0.0"
764-
fs-minipass "^2.0.0"
765-
minipass "^4.0.0"
766-
minizlib "^2.1.1"
767-
mkdirp "^1.0.3"
768-
yallist "^4.0.0"
769-
770753
unique-filename@^3.0.0:
771754
version "3.0.0"
772755
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-3.0.0.tgz#48ba7a5a16849f5080d26c760c86cf5cf05770ea"

cli/Cargo.lock

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

cli/src/tunnels/code_server.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,9 @@ impl<'a> ServerBuilder<'a> {
606606
// Original issue: https://github.com/microsoft/vscode/issues/184058
607607
// Partial fix: https://github.com/microsoft/vscode/pull/184621
608608
#[cfg(target_os = "windows")]
609-
let cmd = cmd.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW);
609+
let cmd = cmd.creation_flags(
610+
winapi::um::winbase::CREATE_NO_WINDOW | winapi::um::winbase::CREATE_NEW_PROCESS_GROUP | winapi::um::winbase::CREATE_BREAKAWAY_FROM_JOB,
611+
);
610612

611613
let child = cmd
612614
.stderr(std::process::Stdio::piped())

cli/src/tunnels/service_macos.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl ServiceManager for LaunchdService {
8686
match capture_command_and_check_status("launchctl", &["stop", &get_service_label()]).await {
8787
Ok(_) => {}
8888
// status 3 == "no such process"
89-
Err(CodeError::CommandFailed { code, .. }) if code == 3 => {}
89+
Err(CodeError::CommandFailed { code: 3, .. }) => {}
9090
Err(e) => return Err(wrap(e, "error stopping service").into()),
9191
};
9292

extensions/markdown-language-features/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@
494494
]
495495
},
496496
"markdown.editor.filePaste.enabled": {
497-
"type": "boolean",
497+
"type": "string",
498498
"scope": "resource",
499499
"markdownDescription": "%configuration.markdown.editor.filePaste.enabled%",
500500
"default": "smart",

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

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,26 @@ import { conditionalRegistration, requireMinVersion, requireSomeCapability } fro
1818

1919

2020
interface OrganizeImportsCommandMetadata {
21-
readonly ids: readonly string[];
2221
readonly title: string;
2322
readonly minVersion?: API;
2423
readonly kind: vscode.CodeActionKind;
2524
readonly mode: OrganizeImportsMode;
2625
}
2726

2827
const organizeImportsCommand: OrganizeImportsCommandMetadata = {
29-
ids: ['typescript.organizeImports'],
3028
title: vscode.l10n.t("Organize Imports"),
3129
kind: vscode.CodeActionKind.SourceOrganizeImports,
3230
mode: OrganizeImportsMode.All,
3331
};
3432

3533
const sortImportsCommand: OrganizeImportsCommandMetadata = {
36-
ids: ['typescript.sortImports', 'javascript.sortImports'],
3734
minVersion: API.v430,
3835
title: vscode.l10n.t("Sort Imports"),
3936
kind: vscode.CodeActionKind.Source.append('sortImports'),
4037
mode: OrganizeImportsMode.SortAndCombine,
4138
};
4239

4340
const removeUnusedImportsCommand: OrganizeImportsCommandMetadata = {
44-
ids: ['typescript.removeUnusedImports', 'javascript.removeUnusedImports'],
4541
minVersion: API.v490,
4642
title: vscode.l10n.t("Remove Unused Imports"),
4743
kind: vscode.CodeActionKind.Source.append('removeUnusedImports'),
@@ -50,14 +46,14 @@ const removeUnusedImportsCommand: OrganizeImportsCommandMetadata = {
5046

5147
class OrganizeImportsCommand implements Command {
5248

49+
public static readonly ID = '_typescript.organizeImports';
50+
public readonly id = OrganizeImportsCommand.ID;
51+
5352
constructor(
54-
public readonly id: string,
55-
private readonly commandMetadata: OrganizeImportsCommandMetadata,
56-
private readonly client: ITypeScriptServiceClient,
5753
private readonly telemetryReporter: TelemetryReporter,
5854
) { }
5955

60-
public async execute(file?: string): Promise<any> {
56+
public async execute(): Promise<any> {
6157
/* __GDPR__
6258
"organizeImports.execute" : {
6359
"owner": "mjbvz",
@@ -67,48 +63,20 @@ class OrganizeImportsCommand implements Command {
6763
}
6864
*/
6965
this.telemetryReporter.logTelemetry('organizeImports.execute', {});
70-
if (!file) {
71-
const activeEditor = vscode.window.activeTextEditor;
72-
if (!activeEditor) {
73-
vscode.window.showErrorMessage(vscode.l10n.t("Organize Imports failed. No resource provided."));
74-
return;
75-
}
76-
77-
const resource = activeEditor.document.uri;
78-
const document = await vscode.workspace.openTextDocument(resource);
79-
const openedFiledPath = this.client.toOpenTsFilePath(document);
80-
if (!openedFiledPath) {
81-
vscode.window.showErrorMessage(vscode.l10n.t("Organize Imports failed. Unknown file type."));
82-
return;
83-
}
84-
85-
file = openedFiledPath;
86-
}
87-
88-
const args: Proto.OrganizeImportsRequestArgs = {
89-
scope: {
90-
type: 'file',
91-
args: {
92-
file
93-
}
94-
},
95-
// Deprecated in 4.9; `mode` takes priority
96-
skipDestructiveCodeActions: this.commandMetadata.mode === OrganizeImportsMode.SortAndCombine,
97-
mode: typeConverters.OrganizeImportsMode.toProtocolOrganizeImportsMode(this.commandMetadata.mode),
98-
};
99-
const response = await this.client.interruptGetErr(() => this.client.execute('organizeImports', args, nulToken));
100-
if (response.type !== 'response' || !response.body) {
101-
return;
102-
}
66+
}
67+
}
10368

104-
if (response.body.length) {
105-
const edits = typeConverters.WorkspaceEdit.fromFileCodeEdits(this.client, response.body);
106-
return vscode.workspace.applyEdit(edits);
107-
}
69+
class ImportCodeAction extends vscode.CodeAction {
70+
constructor(
71+
title: string,
72+
kind: vscode.CodeActionKind,
73+
public readonly document: vscode.TextDocument,
74+
) {
75+
super(title, kind);
10876
}
10977
}
11078

111-
class ImportsCodeActionProvider implements vscode.CodeActionProvider {
79+
class ImportsCodeActionProvider implements vscode.CodeActionProvider<ImportCodeAction> {
11280

11381
constructor(
11482
private readonly client: ITypeScriptServiceClient,
@@ -117,31 +85,62 @@ class ImportsCodeActionProvider implements vscode.CodeActionProvider {
11785
private readonly fileConfigManager: FileConfigurationManager,
11886
telemetryReporter: TelemetryReporter,
11987
) {
120-
for (const id of commandMetadata.ids) {
121-
commandManager.register(new OrganizeImportsCommand(id, commandMetadata, client, telemetryReporter));
122-
}
88+
commandManager.register(new OrganizeImportsCommand(telemetryReporter));
12389
}
12490

12591
public provideCodeActions(
12692
document: vscode.TextDocument,
12793
_range: vscode.Range,
12894
context: vscode.CodeActionContext,
129-
token: vscode.CancellationToken
130-
): vscode.CodeAction[] {
95+
_token: vscode.CancellationToken
96+
): ImportCodeAction[] {
97+
if (!context.only?.contains(this.commandMetadata.kind)) {
98+
return [];
99+
}
100+
131101
const file = this.client.toOpenTsFilePath(document);
132102
if (!file) {
133103
return [];
134104
}
135105

136-
if (!context.only?.contains(this.commandMetadata.kind)) {
137-
return [];
106+
return [new ImportCodeAction(this.commandMetadata.title, this.commandMetadata.kind, document)];
107+
}
108+
109+
async resolveCodeAction(codeAction: ImportCodeAction, token: vscode.CancellationToken): Promise<ImportCodeAction | undefined> {
110+
const response = await this.client.interruptGetErr(async () => {
111+
await this.fileConfigManager.ensureConfigurationForDocument(codeAction.document, token);
112+
if (token.isCancellationRequested) {
113+
return;
114+
}
115+
116+
const file = this.client.toOpenTsFilePath(codeAction.document);
117+
if (!file) {
118+
return;
119+
}
120+
121+
const args: Proto.OrganizeImportsRequestArgs = {
122+
scope: {
123+
type: 'file',
124+
args: { file }
125+
},
126+
// Deprecated in 4.9; `mode` takes priority
127+
skipDestructiveCodeActions: this.commandMetadata.mode === OrganizeImportsMode.SortAndCombine,
128+
mode: typeConverters.OrganizeImportsMode.toProtocolOrganizeImportsMode(this.commandMetadata.mode),
129+
};
130+
131+
return this.client.execute('organizeImports', args, nulToken);
132+
});
133+
if (response?.type !== 'response' || !response.body || token.isCancellationRequested) {
134+
return;
135+
}
136+
137+
if (response.body.length) {
138+
codeAction.edit = typeConverters.WorkspaceEdit.fromFileCodeEdits(this.client, response.body);
138139
}
139140

140-
this.fileConfigManager.ensureConfigurationForDocument(document, token);
141+
codeAction.command = { command: OrganizeImportsCommand.ID, title: '', arguments: [] };
141142

142-
const action = new vscode.CodeAction(this.commandMetadata.title, this.commandMetadata.kind);
143-
action.command = { title: '', command: this.commandMetadata.ids[0], arguments: [file] };
144-
return [action];
143+
return codeAction;
145144
}
146145
}
147146

extensions/vscode-api-tests/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
"treeViewActiveItem",
5454
"treeViewReveal",
5555
"workspaceTrust",
56-
"telemetry",
57-
"windowActivity"
56+
"telemetry"
5857
],
5958
"private": true,
6059
"activationEvents": [],

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@
8181
"@vscode/windows-mutex": "^0.5.0",
8282
"@vscode/windows-process-tree": "^0.6.0",
8383
"@vscode/windows-registry": "^1.1.0",
84-
"@xterm/addon-canvas": "0.7.0-beta.12",
85-
"@xterm/addon-image": "0.8.0-beta.12",
86-
"@xterm/addon-search": "0.15.0-beta.12",
87-
"@xterm/addon-serialize": "0.13.0-beta.12",
88-
"@xterm/addon-unicode11": "0.8.0-beta.12",
89-
"@xterm/addon-webgl": "0.18.0-beta.12",
90-
"@xterm/headless": "5.5.0-beta.12",
91-
"@xterm/xterm": "5.5.0-beta.12",
84+
"@xterm/addon-canvas": "0.8.0-beta.2",
85+
"@xterm/addon-image": "0.9.0-beta.2",
86+
"@xterm/addon-search": "0.16.0-beta.2",
87+
"@xterm/addon-serialize": "0.14.0-beta.2",
88+
"@xterm/addon-unicode11": "0.9.0-beta.2",
89+
"@xterm/addon-webgl": "0.19.0-beta.2",
90+
"@xterm/headless": "5.6.0-beta.2",
91+
"@xterm/xterm": "5.6.0-beta.2",
9292
"graceful-fs": "4.2.11",
9393
"http-proxy-agent": "^7.0.0",
9494
"https-proxy-agent": "^7.0.2",

remote/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
"@vscode/vscode-languagedetection": "1.0.21",
1414
"@vscode/windows-process-tree": "^0.6.0",
1515
"@vscode/windows-registry": "^1.1.0",
16-
"@xterm/addon-canvas": "0.7.0-beta.12",
17-
"@xterm/addon-image": "0.8.0-beta.12",
18-
"@xterm/addon-search": "0.15.0-beta.12",
19-
"@xterm/addon-serialize": "0.13.0-beta.12",
20-
"@xterm/addon-unicode11": "0.8.0-beta.12",
21-
"@xterm/addon-webgl": "0.18.0-beta.12",
22-
"@xterm/headless": "5.5.0-beta.12",
23-
"@xterm/xterm": "5.5.0-beta.12",
16+
"@xterm/addon-canvas": "0.8.0-beta.2",
17+
"@xterm/addon-image": "0.9.0-beta.2",
18+
"@xterm/addon-search": "0.16.0-beta.2",
19+
"@xterm/addon-serialize": "0.14.0-beta.2",
20+
"@xterm/addon-unicode11": "0.9.0-beta.2",
21+
"@xterm/addon-webgl": "0.19.0-beta.2",
22+
"@xterm/headless": "5.6.0-beta.2",
23+
"@xterm/xterm": "5.6.0-beta.2",
2424
"cookie": "^0.4.0",
2525
"graceful-fs": "4.2.11",
2626
"http-proxy-agent": "^7.0.0",

0 commit comments

Comments
 (0)