forked from redhat-developer/vscode-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotocol.ts
More file actions
280 lines (230 loc) · 7.16 KB
/
protocol.ts
File metadata and controls
280 lines (230 loc) · 7.16 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
'use strict';
import { RequestType, NotificationType, TextDocumentIdentifier, ExecuteCommandParams, CodeActionParams, WorkspaceEdit } from 'vscode-languageclient';
import { Command, Range } from 'vscode';
/**
* The message type. Copied from vscode protocol
*/
export enum MessageType {
/**
* An error message.
*/
Error = 1,
/**
* A warning message.
*/
Warning = 2,
/**
* An information message.
*/
Info = 3,
/**
* A log message.
*/
Log = 4,
}
/**
* A functionality status
*/
export enum FeatureStatus {
/**
* Disabled.
*/
disabled = 0,
/**
* Enabled manually.
*/
interactive = 1,
/**
* Enabled automatically.
*/
automatic = 2,
}
export enum CompileWorkspaceStatus {
FAILED = 0,
SUCCEED = 1,
WITHERROR = 2,
CANCELLED = 3,
}
export interface StatusReport {
message: string;
type: string;
}
export interface ProgressReport {
id: string;
task: string;
subTask: string;
status: string;
workDone: number;
totalWork: number;
complete: boolean;
}
export interface ActionableMessage {
severity: MessageType;
message: string;
data?: any;
commands?: Command[];
}
export namespace StatusNotification {
export const type = new NotificationType<StatusReport, void >('language/status');
}
export namespace ProgressReportNotification {
export const type = new NotificationType<ProgressReport, void >('language/progressReport');
}
export namespace ClassFileContentsRequest {
export const type = new RequestType<TextDocumentIdentifier, string, void, void> ('java/classFileContents');
}
export namespace ProjectConfigurationUpdateRequest {
export const type = new NotificationType<TextDocumentIdentifier, void> ('java/projectConfigurationUpdate');
}
export namespace ActionableNotification {
export const type = new NotificationType<ActionableMessage, void>('language/actionableNotification');
}
export namespace CompileWorkspaceRequest {
export const type = new RequestType<boolean, CompileWorkspaceStatus, void, void>('java/buildWorkspace');
}
export namespace ExecuteClientCommandRequest {
export const type = new RequestType<ExecuteCommandParams, any, void, void>('workspace/executeClientCommand');
}
export namespace SendNotificationRequest {
export const type = new RequestType<ExecuteCommandParams, any, void, void>('workspace/notify');
}
export interface SourceAttachmentRequest {
classFileUri: string;
attributes?: SourceAttachmentAttribute;
}
export interface SourceAttachmentResult {
errorMessage?: string;
attributes?: SourceAttachmentAttribute;
}
export interface SourceAttachmentAttribute {
jarPath?: string;
sourceAttachmentPath?: string;
sourceAttachmentEncoding?: string;
canEditEncoding?: boolean;
}
export interface OverridableMethod {
key: string;
name: string;
parameters: string[];
unimplemented: boolean;
declaringClass: string;
declaringClassType: string;
}
export interface OverridableMethodsResponse {
type: string;
methods: OverridableMethod[];
}
export namespace ListOverridableMethodsRequest {
export const type = new RequestType<CodeActionParams, OverridableMethodsResponse, void, void>('java/listOverridableMethods');
}
export interface AddOverridableMethodParams {
context: CodeActionParams;
overridableMethods: OverridableMethod[];
}
export namespace AddOverridableMethodsRequest {
export const type = new RequestType<AddOverridableMethodParams, WorkspaceEdit, void, void>('java/addOverridableMethods');
}
export interface VariableBinding {
bindingKey: string;
name: string;
type: string;
}
export interface CheckHashCodeEqualsResponse {
type: string;
fields: VariableBinding[];
existingMethods: string[];
}
export namespace CheckHashCodeEqualsStatusRequest {
export const type = new RequestType<CodeActionParams, CheckHashCodeEqualsResponse, void, void>('java/checkHashCodeEqualsStatus');
}
export interface GenerateHashCodeEqualsParams {
context: CodeActionParams;
fields: VariableBinding[];
regenerate: boolean;
}
export namespace GenerateHashCodeEqualsRequest {
export const type = new RequestType<GenerateHashCodeEqualsParams, WorkspaceEdit, void, void>('java/generateHashCodeEquals');
}
export namespace OrganizeImportsRequest {
export const type = new RequestType<CodeActionParams, WorkspaceEdit, void, void>('java/organizeImports');
}
export interface ImportCandidate {
fullyQualifiedName: string;
id: string;
}
export interface ImportSelection {
candidates: ImportCandidate[];
range: Range;
}
export interface CheckToStringResponse {
type: string;
fields: VariableBinding[];
exists: boolean;
}
export namespace CheckToStringStatusRequest {
export const type = new RequestType<CodeActionParams, CheckToStringResponse, void, void>('java/checkToStringStatus');
}
export interface GenerateToStringParams {
context: CodeActionParams;
fields: VariableBinding[];
}
export namespace GenerateToStringRequest {
export const type = new RequestType<GenerateToStringParams, WorkspaceEdit, void, void>('java/generateToString');
}
export interface AccessorField {
fieldName: string;
isStatic: boolean;
generateGetter: boolean;
generateSetter: boolean;
}
export namespace ResolveUnimplementedAccessorsRequest {
export const type = new RequestType<CodeActionParams, AccessorField[], void, void>('java/resolveUnimplementedAccessors');
}
export interface GenerateAccessorsParams {
context: CodeActionParams;
accessors: AccessorField[];
}
export namespace GenerateAccessorsRequest {
export const type = new RequestType<GenerateAccessorsParams, WorkspaceEdit, void, void>('java/generateAccessors');
}
export interface MethodBinding {
bindingKey: string;
name: string;
parameters: string[];
}
export interface CheckConstructorsResponse {
constructors: MethodBinding[];
fields: VariableBinding[];
}
export namespace CheckConstructorStatusRequest {
export const type = new RequestType<CodeActionParams, CheckConstructorsResponse, void, void>('java/checkConstructorsStatus');
}
export interface GenerateConstructorsParams {
context: CodeActionParams;
constructors: MethodBinding[];
fields: VariableBinding[];
}
export namespace GenerateConstructorsRequest {
export const type = new RequestType<GenerateConstructorsParams, WorkspaceEdit, void, void>('java/generateConstructors');
}
export interface DelegateField {
field: VariableBinding;
delegateMethods: MethodBinding[];
}
export interface CheckDelegateMethodsResponse {
delegateFields: DelegateField[];
}
export namespace CheckDelegateMethodsStatusRequest {
export const type = new RequestType<CodeActionParams, CheckDelegateMethodsResponse, void, void>('java/checkDelegateMethodsStatus');
}
export interface DelegateEntry {
field: VariableBinding;
delegateMethod: MethodBinding;
}
export interface GenerateDelegateMethodsParams {
context: CodeActionParams;
delegateEntries: DelegateEntry[];
}
export namespace GenerateDelegateMethodsRequest {
export const type = new RequestType<GenerateDelegateMethodsParams, WorkspaceEdit, void, void>('java/generateDelegateMethods');
}