Skip to content

Commit 0f6eab2

Browse files
make proto objects not optional by default (cline#5985)
1 parent 016ac1e commit 0f6eab2

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

proto/cline/common.proto

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ message Metadata {
88
}
99

1010
message EmptyRequest {
11-
Metadata metadata = 1;
1211
}
1312

1413
message Empty {
1514
}
1615

1716
message StringRequest {
18-
Metadata metadata = 1;
1917
string value = 2;
2018
}
2119

2220
message StringArrayRequest {
23-
Metadata metadata = 1;
2421
repeated string value = 2;
2522
}
2623

@@ -29,7 +26,6 @@ message String {
2926
}
3027

3128
message Int64Request {
32-
Metadata metadata = 1;
3329
int64 value = 2;
3430
}
3531

@@ -38,7 +34,6 @@ message Int64 {
3834
}
3935

4036
message BytesRequest {
41-
Metadata metadata = 1;
4237
bytes value = 2;
4338
}
4439

@@ -47,7 +42,6 @@ message Bytes {
4742
}
4843

4944
message BooleanRequest {
50-
Metadata metadata = 1;
5145
bool value = 2;
5246
}
5347

proto/host/window.proto

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ package host;
44
option java_package = "bot.cline.host.proto";
55
option java_multiple_files = true;
66

7-
import "cline/common.proto";
8-
97
// Provides methods for working with IDE windows and editors.
108
service WindowService {
119
// Opens a text document in the IDE editor and returns editor information.
@@ -40,7 +38,6 @@ service WindowService {
4038
}
4139

4240
message ShowTextDocumentRequest {
43-
cline.Metadata metadata = 1;
4441
string path = 2;
4542
optional ShowTextDocumentOptions options = 3;
4643
}
@@ -59,7 +56,6 @@ message TextEditorInfo {
5956
}
6057

6158
message ShowOpenDialogueRequest {
62-
cline.Metadata metadata = 1;
6359
optional bool can_select_many = 2;
6460
optional string open_label = 3;
6561
optional ShowOpenDialogueFilterOption filters = 4;

scripts/build-proto.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const TS_PROTO_OPTIONS = [
3131
"esModuleInterop=true",
3232
"outputServices=generic-definitions", // output generic ServiceDefinitions
3333
"outputIndex=true", // output an index file for each package which exports all protos in the package.
34-
"useOptionals=messages", // Message fields are optional, scalars are not.
34+
"useOptionals=none", // scalar and message fields are required unless they are marked as optional.
3535
"useDate=false", // Timestamp fields will not be automatically converted to Date.
3636
]
3737

src/integrations/diagnostics/__tests__/index.test.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ describe("Diagnostics Tests", () => {
4747
{
4848
severity: DiagnosticSeverity.DIAGNOSTIC_ERROR,
4949
message: "Error in file1",
50+
range: {
51+
start: { line: 0, character: 0 },
52+
end: { line: 0, character: 10 },
53+
},
5054
},
5155
],
5256
},
@@ -114,6 +118,10 @@ describe("Diagnostics Tests", () => {
114118
{
115119
severity: DiagnosticSeverity.DIAGNOSTIC_ERROR,
116120
message: "Error in file1",
121+
range: {
122+
start: { line: 0, character: 0 },
123+
end: { line: 0, character: 10 },
124+
},
117125
},
118126
],
119127
},
@@ -125,6 +133,10 @@ describe("Diagnostics Tests", () => {
125133
{
126134
severity: DiagnosticSeverity.DIAGNOSTIC_ERROR,
127135
message: "Error in file1",
136+
range: {
137+
start: { line: 0, character: 0 },
138+
end: { line: 0, character: 10 },
139+
},
128140
},
129141
],
130142
},
@@ -134,6 +146,10 @@ describe("Diagnostics Tests", () => {
134146
{
135147
severity: DiagnosticSeverity.DIAGNOSTIC_ERROR,
136148
message: "Error in file2",
149+
range: {
150+
start: { line: 0, character: 0 },
151+
end: { line: 0, character: 10 },
152+
},
137153
},
138154
],
139155
},
@@ -198,6 +214,10 @@ describe("Diagnostics Tests", () => {
198214
{
199215
severity: DiagnosticSeverity.DIAGNOSTIC_WARNING,
200216
message: "Warning message",
217+
range: {
218+
start: { line: 0, character: 0 },
219+
end: { line: 0, character: 10 },
220+
},
201221
},
202222
],
203223
},
@@ -240,6 +260,10 @@ describe("Diagnostics Tests", () => {
240260
{
241261
severity: DiagnosticSeverity.DIAGNOSTIC_ERROR,
242262
message: "File-level error",
263+
range: {
264+
start: { line: 0, character: 0 },
265+
end: { line: 0, character: 10 },
266+
},
243267
},
244268
],
245269
},
@@ -248,7 +272,7 @@ describe("Diagnostics Tests", () => {
248272

249273
const result = await diagnosticsToProblemsString(diagnostics, severities)
250274

251-
expect(result).to.equal("src/file1.ts\n- [Error] Line : File-level error")
275+
expect(result).to.equal("src/file1.ts\n- [Error] Line 1: File-level error")
252276
})
253277

254278
it("should handle diagnostics with missing start property in range", async () => {

src/shared/proto-conversions/cline-message.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ export function convertClineMessageToProto(message: AppClineMessage): ProtoCline
188188
endIndex: message.conversationHistoryDeletedRange[1],
189189
}
190190
: undefined,
191+
// Additional optional fields for specific ask/say types
192+
sayTool: undefined,
193+
sayBrowserAction: undefined,
194+
browserActionResult: undefined,
195+
askUseMcpServer: undefined,
196+
planModeResponse: undefined,
197+
askQuestion: undefined,
198+
askNewTask: undefined,
199+
apiReqInfo: undefined,
191200
}
192201

193202
return protoMessage

0 commit comments

Comments
 (0)