Allow clients to run Zed tasks on remote projects (#12199)

Release Notes:

- Enabled Zed tasks on remote projects with ssh connection string
specified

---------

Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-05-24 22:26:57 +03:00 committed by GitHub
parent df35fd0026
commit 055a13a9b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 1250 additions and 600 deletions

View file

@ -245,7 +245,12 @@ message Envelope {
RegenerateDevServerToken regenerate_dev_server_token = 200;
RegenerateDevServerTokenResponse regenerate_dev_server_token_response = 201;
RenameDevServer rename_dev_server = 202; // Current max
RenameDevServer rename_dev_server = 202;
TaskContextForLocation task_context_for_location = 203;
TaskContext task_context = 204;
TaskTemplatesResponse task_templates_response = 205;
TaskTemplates task_templates = 206; // Current max
}
reserved 158 to 161;
@ -2118,3 +2123,71 @@ message GetSupermavenApiKey {}
message GetSupermavenApiKeyResponse {
string api_key = 1;
}
message TaskContextForLocation {
uint64 project_id = 1;
Location location = 2;
}
message TaskContext {
optional string cwd = 1;
map<string, string> task_variables = 2;
}
message TaskTemplates {
uint64 project_id = 1;
optional Location location = 2;
optional uint64 worktree_id = 3;
}
message TaskTemplatesResponse {
repeated TemplatePair templates = 1;
}
message TemplatePair {
TaskSourceKind kind = 1;
TaskTemplate template = 2;
}
message TaskTemplate {
string label = 1;
string command = 2;
repeated string args = 3;
map<string, string> env = 4;
optional string cwd = 5;
bool use_new_terminal = 6;
bool allow_concurrent_runs = 7;
RevealStrategy reveal = 8;
repeated string tags = 9;
}
enum RevealStrategy {
Always = 0;
Never = 1;
}
message TaskSourceKind {
oneof kind {
UserInput user_input = 1;
Worktree worktree = 2;
AbsPath abs_path = 3;
Language language = 4;
}
message UserInput {}
message Worktree {
uint64 id = 1;
string abs_path = 2;
string id_base = 3;
}
message AbsPath {
string id_base = 1;
string abs_path = 2;
}
message Language {
string name = 1;
}
}

View file

@ -279,6 +279,10 @@ messages!(
(StartLanguageServer, Foreground),
(SynchronizeBuffers, Foreground),
(SynchronizeBuffersResponse, Foreground),
(TaskContextForLocation, Background),
(TaskContext, Background),
(TaskTemplates, Background),
(TaskTemplatesResponse, Background),
(Test, Foreground),
(Unfollow, Foreground),
(UnshareProject, Foreground),
@ -326,7 +330,7 @@ messages!(
(RegenerateDevServerToken, Foreground),
(RegenerateDevServerTokenResponse, Foreground),
(RenameDevServer, Foreground),
(OpenNewBuffer, Foreground)
(OpenNewBuffer, Foreground),
);
request_messages!(
@ -414,6 +418,8 @@ request_messages!(
(SetChannelVisibility, Ack),
(ShareProject, ShareProjectResponse),
(SynchronizeBuffers, SynchronizeBuffersResponse),
(TaskContextForLocation, TaskContext),
(TaskTemplates, TaskTemplatesResponse),
(Test, Test),
(UpdateBuffer, Ack),
(UpdateParticipantLocation, Ack),
@ -481,6 +487,8 @@ entity_messages!(
SearchProject,
StartLanguageServer,
SynchronizeBuffers,
TaskContextForLocation,
TaskTemplates,
UnshareProject,
UpdateBuffer,
UpdateBufferFile,