-
Notifications
You must be signed in to change notification settings - Fork 15
/
language_server.proto
169 lines (144 loc) · 5.03 KB
/
language_server.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// Copyright Exafunction, Inc.
syntax = "proto3";
package exa.language_server_pb;
import "exa/codeium_common_pb/codeium_common.proto";
import "validate/validate.proto";
option go_package = "github.com/Exafunction/Exafunction/exa/language_server_pb";
service LanguageServerService {
rpc GetCompletions(GetCompletionsRequest) returns (GetCompletionsResponse) {}
rpc AcceptCompletion(AcceptCompletionRequest) returns (AcceptCompletionResponse) {}
rpc GetAuthToken(GetAuthTokenRequest) returns (GetAuthTokenResponse) {}
}
message MultilineConfig {
// Multiline model threshold. 0-1, higher = more single line, lower = more multiline,
// 0.0 = only_multiline, default is 0.5
float threshold = 1;
}
// Next ID: 9, Previous field: disable_cache.
message GetCompletionsRequest {
codeium_common_pb.Metadata metadata = 1 [(validate.rules).message.required = true];
Document document = 2 [(validate.rules).message.required = true];
codeium_common_pb.EditorOptions editor_options = 3 [(validate.rules).message.required = true];
repeated Document other_documents = 5;
ExperimentConfig experiment_config = 7;
string model_name = 10;
MultilineConfig multiline_config = 13;
}
// Next ID: 5, Previous field: latency_info.
message GetCompletionsResponse {
State state = 1;
repeated CompletionItem completion_items = 2;
}
// Next ID: 3, Previous field: completion_id.
message AcceptCompletionRequest {
codeium_common_pb.Metadata metadata = 1 [(validate.rules).message.required = true];
string completion_id = 2;
}
// Next ID: 1, Previous field: N/A.
message AcceptCompletionResponse {}
// Next ID: 1, Previous field: N/A.
message GetAuthTokenRequest {}
// Next ID: 3, Previous field: uuid.
message GetAuthTokenResponse {
string auth_token = 1;
string uuid = 2;
}
/*****************************************************************************/
/* Helper Messages */
/*****************************************************************************/
message DocumentPosition {
// 0-indexed. Measured in UTF-8 bytes.
uint64 row = 1;
// 0-indexed. Measured in UTF-8 bytes.
uint64 col = 2;
}
// Next ID: 9, Previous field: cursor_position.
message Document {
string absolute_path = 1;
// Path relative to the root of the workspace.
string relative_path = 2;
string text = 3;
// Language ID provided by the editor.
string editor_language = 4 [(validate.rules).string.min_len = 1];
// Language enum standardized across editors.
codeium_common_pb.Language language = 5;
// Measured in number of UTF-8 bytes.
uint64 cursor_offset = 6;
// May be present instead of cursor_offset.
DocumentPosition cursor_position = 8;
// \n or \r\n, if known.
string line_ending = 7 [(validate.rules).string = {
in: [
"",
"\n",
"\r\n"
]
}];
}
message ExperimentConfig {
repeated codeium_common_pb.ExperimentKey force_enable_experiments = 1 [(validate.rules).repeated.unique = true];
}
enum CodeiumState {
CODEIUM_STATE_UNSPECIFIED = 0;
CODEIUM_STATE_INACTIVE = 1;
CODEIUM_STATE_PROCESSING = 2;
CODEIUM_STATE_SUCCESS = 3;
CODEIUM_STATE_WARNING = 4;
CODEIUM_STATE_ERROR = 5;
}
// Next ID: 3, Previous field: message.
message State {
CodeiumState state = 1;
string message = 2;
}
enum LineType {
LINE_TYPE_UNSPECIFIED = 0;
LINE_TYPE_SINGLE = 1;
LINE_TYPE_MULTI = 2;
}
// Next ID: 5, Previous field: end_position.
message Range {
uint64 start_offset = 1;
uint64 end_offset = 2;
DocumentPosition start_position = 3;
DocumentPosition end_position = 4;
}
message Suffix {
// Text to insert after the cursor when accepting the completion.
string text = 1;
// Cursor position delta (as signed offset) from the end of the inserted
// completion (including the suffix).
int64 delta_cursor_offset = 2;
}
enum CompletionPartType {
COMPLETION_PART_TYPE_UNSPECIFIED = 0;
// Single-line completion parts that appear within an existing line of text.
COMPLETION_PART_TYPE_INLINE = 1;
// Possibly multi-line completion parts that appear below an existing line of text.
COMPLETION_PART_TYPE_BLOCK = 2;
// Like COMPLETION_PART_TYPE_INLINE, but overwrites the existing text.
COMPLETION_PART_TYPE_INLINE_MASK = 3;
}
// Represents a contiguous part of the completion text that is not
// already in the document.
// Next ID: 4, Previous field: prefix.
message CompletionPart {
string text = 1;
// Offset in the original document where the part starts. For block
// parts, this is always the end of the line before the block.
uint64 offset = 2;
CompletionPartType type = 3;
// The section of the original line that came before this part. Only valid for
// COMPLETION_PART_TYPE_INLINE.
string prefix = 4;
// In the case of COMPLETION_PART_TYPE_BLOCK, represents the line it is below.
uint64 line = 5;
}
// Next ID: 9, Previous field: completion_parts.
message CompletionItem {
codeium_common_pb.Completion completion = 1;
Suffix suffix = 5;
Range range = 2;
codeium_common_pb.CompletionSource source = 3;
repeated CompletionPart completion_parts = 8;
}