Update the diff service to use a unique id to track open diff editor in external platforms. Store the diff Id in the ExternalDiffViewEditor when the diff is opened. It will serve the same purpose as the activeDiffEditor property on vscode, it can be used to manipulate the diff editor tab. Add the implementation of replaceText in the ExternalDiffViewEditor.
40 lines
938 B
Protocol Buffer
40 lines
938 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package host;
|
|
option java_package = "bot.cline.host.proto";
|
|
option java_multiple_files = true;
|
|
|
|
import "common.proto";
|
|
|
|
// Provides methods for diff views.
|
|
service DiffService {
|
|
// Open the diff view/editor.
|
|
rpc openDiff(OpenDiffRequest) returns (OpenDiffResponse);
|
|
rpc replaceText(ReplaceTextRequest) returns (ReplaceTextResponse);
|
|
}
|
|
|
|
message OpenDiffRequest {
|
|
optional cline.Metadata metadata = 1;
|
|
// The absolute path of the document being edited.
|
|
optional string path = 2;
|
|
// The new content for the file.
|
|
optional string content = 3;
|
|
}
|
|
|
|
message OpenDiffResponse {
|
|
// A unique identifier for the diff view that was opened.
|
|
optional string diff_id = 1;
|
|
}
|
|
|
|
message ReplaceTextRequest {
|
|
optional cline.Metadata metadata = 1;
|
|
optional string diff_id = 2;
|
|
optional string content = 3;
|
|
optional int32 start_line = 4;
|
|
optional int32 end_line = 5;
|
|
}
|
|
|
|
message ReplaceTextResponse {
|
|
// TBD
|
|
}
|