-
-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathprotocol.ts
More file actions
150 lines (134 loc) Β· 4.23 KB
/
protocol.ts
File metadata and controls
150 lines (134 loc) Β· 4.23 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
import type { CodeMapping, DocumentDropEdit } from '@volar/language-server';
import * as protocol from 'vscode-languageclient';
export * from 'vscode-languageclient';
/**
* Client request server
*/
export namespace FindFileReferenceRequest {
export type ParamsType = {
textDocument: protocol.TextDocumentIdentifier;
};
export type ResponseType = protocol.Location[] | null | undefined;
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>('volar/client/findFileReference');
}
export namespace GetMatchTsConfigRequest {
export type ParamsType = protocol.TextDocumentIdentifier;
export type ResponseType = { uri: string } | null | undefined;
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>('volar/client/tsconfig');
}
export namespace AutoInsertRequest {
export type ParamsType = {
textDocument: protocol.TextDocumentIdentifier;
selection: protocol.Position;
change: {
rangeOffset: number;
rangeLength: number;
text: string;
};
};
export type ResponseType = string | null | undefined;
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>('volar/client/autoInsert');
}
export namespace ReloadProjectNotification {
export const type = new protocol.NotificationType<protocol.TextDocumentIdentifier>('volar/client/reloadProject');
}
/**
* Document Drop
*/
export namespace DocumentDropRequest {
export type ParamsType = protocol.TextDocumentPositionParams & {
dataTransfer: {
mimeType: string;
value: any;
file?: {
name: string;
uri?: string;
};
}[];
};
export type ResponseType = DocumentDropEdit | null | undefined;
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>('volar/client/documentDrop');
}
export namespace DocumentDrop_DataTransferItemAsStringRequest {
export type ParamsType = {
mimeType: string;
};
export type ResponseType = string;
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>(
'volar/client/documentDrop/asString',
);
}
export namespace DocumentDrop_DataTransferItemFileDataRequest {
export type ParamsType = {
mimeType: string;
};
export type ResponseType = Uint8Array;
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>(
'volar/client/documentDrop/fileData',
);
}
/**
* Labs
*/
export namespace UpdateVirtualCodeStateNotification {
export type ParamsType = {
fileUri: string;
virtualCodeId: string;
disabled: boolean;
};
export const type = new protocol.NotificationType<ParamsType>('volar/client/labs/updateVirtualFileState');
}
export namespace UpdateServicePluginStateNotification {
export type ParamsType = {
uri: string;
serviceId: number;
disabled: boolean;
};
export const type = new protocol.NotificationType<ParamsType>('volar/client/labs/updateServicePluginState');
}
export namespace GetServicePluginsRequest {
export type ParamsType = protocol.TextDocumentIdentifier;
export type ResponseType =
| {
id: number;
name?: string;
features: string[];
disabled: boolean;
}[]
| null
| undefined;
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>('volar/client/servicePlugins');
}
export namespace GetVirtualFileRequest {
export type VirtualCodeInfo = {
fileUri: string;
virtualCodeId: string;
languageId: string;
version: number;
disabled: boolean;
embeddedCodes: VirtualCodeInfo[];
};
export type ParamsType = protocol.TextDocumentIdentifier;
export type ResponseType = VirtualCodeInfo | null | undefined;
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>('volar/client/virtualFiles');
}
export namespace GetVirtualCodeRequest {
export type ParamsType = {
fileUri: string;
virtualCodeId: string;
};
export type ResponseType = {
content: string;
mappings: Record<string, CodeMapping[]>;
};
export type ErrorType = never;
export const type = new protocol.RequestType<ParamsType, ResponseType, ErrorType>('volar/client/virtualFile');
}