mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 00:09:30 +01:00
AgentHost: Add remote label to workspace (#305822)
* AgentHost: Add remote label to workspace Co-authored-by: Copilot <copilot@github.com> * Fix tests --------- Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -188,7 +188,7 @@ export class RemoteAgentHostSessionsProvider extends Disposable implements ISess
|
||||
const folderName = basename(directoryUri) || workingDirectory;
|
||||
const uri = toAgentHostUri(directoryUri, connectionAuthority);
|
||||
return {
|
||||
label: folderName,
|
||||
label: `${folderName} [${providerLabel}]`,
|
||||
icon: Codicon.remote,
|
||||
repositories: [{ uri, workingDirectory: undefined, detail: providerLabel, baseBranchName: undefined, baseBranchProtected: undefined }],
|
||||
requiresWorkspaceTrust: false,
|
||||
@@ -198,7 +198,7 @@ export class RemoteAgentHostSessionsProvider extends Disposable implements ISess
|
||||
private _buildWorkspaceFromUri(uri: URI): ISessionWorkspace {
|
||||
const folderName = basename(uri) || uri.path;
|
||||
return {
|
||||
label: folderName,
|
||||
label: `${folderName} [${this.label}]`,
|
||||
icon: Codicon.remote,
|
||||
repositories: [{ uri, workingDirectory: undefined, detail: this.label, baseBranchName: undefined, baseBranchProtected: undefined }],
|
||||
requiresWorkspaceTrust: true,
|
||||
|
||||
@@ -175,7 +175,7 @@ suite('RemoteAgentHostSessionsProvider', () => {
|
||||
const uri = URI.parse('vscode-agent-host://auth/home/user/project');
|
||||
const ws = provider.resolveWorkspace(uri);
|
||||
|
||||
assert.strictEqual(ws.label, 'project');
|
||||
assert.strictEqual(ws.label, 'project [Test Host]');
|
||||
assert.strictEqual(ws.repositories.length, 1);
|
||||
assert.strictEqual(ws.repositories[0].uri.toString(), uri.toString());
|
||||
});
|
||||
@@ -376,7 +376,7 @@ suite('RemoteAgentHostSessionsProvider', () => {
|
||||
|
||||
const workspace = wsSession!.workspace.get();
|
||||
assert.ok(workspace, 'Workspace should be populated');
|
||||
assert.strictEqual(workspace!.label, 'myrepo');
|
||||
assert.strictEqual(workspace!.label, 'myrepo [Test Host]');
|
||||
});
|
||||
|
||||
test('session adapter without working directory has no workspace', async () => {
|
||||
|
||||
Reference in New Issue
Block a user