This repository was archived by the owner on Oct 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathrequest-type.ts
More file actions
264 lines (226 loc) · 6.71 KB
/
request-type.ts
File metadata and controls
264 lines (226 loc) · 6.71 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
import { Operation } from 'fast-json-patch'
import * as vscode from 'vscode-languageserver'
export interface InitializeParams extends vscode.InitializeParams {
capabilities: ClientCapabilities
}
/**
* Settings to enable plugin loading
*/
export interface PluginSettings {
allowLocalPluginLoads: boolean
globalPlugins: string[]
pluginProbeLocations: string[]
}
export interface ClientCapabilities extends vscode.ClientCapabilities {
/**
* The client provides support for workspace/xfiles.
*/
xfilesProvider?: boolean
/**
* The client provides support for textDocument/xcontent.
*/
xcontentProvider?: boolean
/**
* The client provides support for cache/get and cache/set methods
*/
xcacheProvider?: boolean
/**
* The client supports receiving the result solely through $/partialResult notifications for requests from the client to the server.
*/
streaming?: boolean
}
export interface ServerCapabilities extends vscode.ServerCapabilities {
xworkspaceReferencesProvider?: boolean
xdefinitionProvider?: boolean
xdependenciesProvider?: boolean
xpackagesProvider?: boolean
/**
* The server supports receiving results solely through $/partialResult notifications for requests from the server to the client.
*/
streaming?: boolean
}
export interface InitializeResult extends vscode.InitializeResult {
capabilities: ServerCapabilities
}
export interface TextDocumentContentParams {
/**
* The text document to receive the content for.
*/
textDocument: vscode.TextDocumentIdentifier
}
export interface WorkspaceFilesParams {
/**
* The URI of a directory to search.
* Can be relative to the rootPath.
* If not given, defaults to rootPath.
*/
base?: string
}
/**
* Represents information about a programming construct that can be used to identify and locate the
* construct's symbol. The identification does not have to be unique, but it should be as unique as
* possible. It is up to the language server to define the schema of this object.
*
* In contrast to `SymbolInformation`, `SymbolDescriptor` includes more concrete, language-specific,
* metadata about the symbol.
*/
export interface SymbolDescriptor {
/**
* The kind of the symbol as a ts.ScriptElementKind
*/
kind: string
/**
* The name of the symbol as returned from TS
*/
name: string
/**
* The kind of the symbol the symbol is contained in, as a ts.ScriptElementKind.
* Is an empty string if the symbol has no container.
*/
containerKind: string
/**
* The name of the symbol the symbol is contained in, as returned from TS.
* Is an empty string if the symbol has no container.
*/
containerName: string
/**
* The file path of the file where the symbol is defined in, relative to the workspace rootPath.
*/
filePath: string
/**
* A PackageDescriptor describing the package this symbol belongs to.
* Is `undefined` if the symbol does not belong to a package.
*/
package?: PackageDescriptor
}
/*
* WorkspaceReferenceParams holds parameters for the extended
* workspace/symbols endpoint (an extension of the original LSP spec).
* If both properties are set, the requirements are AND'd.
*/
export interface WorkspaceSymbolParams {
/**
* A non-empty query string.
*/
query?: string
/**
* A set of properties that describe the symbol to look up.
*/
symbol?: Partial<SymbolDescriptor>
}
/*
* WorkspaceReferenceParams holds parameters for the
* workspace/xreferences endpoint (an extension of the original LSP
* spec).
*/
export interface WorkspaceReferenceParams {
/**
* Metadata about the symbol that is being searched for.
*/
query: Partial<SymbolDescriptor>
/**
* Hints provides optional hints about where the language server should look in order to find
* the symbol (this is an optimization). It is up to the language server to define the schema of
* this object.
*/
hints?: DependencyHints
}
export interface SymbolLocationInformation {
/**
* The location where the symbol is defined, if any
*/
location?: vscode.Location
/**
* Metadata about the symbol that can be used to identify or locate its definition.
*/
symbol: SymbolDescriptor
}
/**
* Represents information about a reference to programming constructs like variables, classes,
* interfaces, etc.
*/
export interface ReferenceInformation {
/**
* The location in the workspace where the `symbol` is referenced.
*/
reference: vscode.Location
/**
* Metadata about the symbol that can be used to identify or locate its definition.
*/
symbol: SymbolDescriptor
}
export interface PackageInformation {
package: PackageDescriptor
dependencies: DependencyReference[]
}
export interface PackageDescriptor {
name: string
version?: string
repoURL?: string
}
export interface DependencyHints {
dependeePackageName?: string
}
export interface DependencyReference {
attributes: PackageDescriptor
hints: DependencyHints
}
/**
* The cache get request is sent from the server to the client to request the value of a cache item
* identified by the provided key.
*/
export interface CacheGetParams {
/**
* The key that identifies the cache item
*/
key: string
}
/**
* The cache set notification is sent from the server to the client to set the value of a cache item
* identified by the provided key. This is a intentionally notification and not a request because
* the server is not supposed to act differently if the cache set failed.
*/
export interface CacheSetParams {
/**
* The key that identifies the cache item
*/
key: string
/**
* The value that should be saved
*/
value: any
}
export interface PartialResultParams {
/**
* The request id to provide parts of the result for
*/
id: number | string
/**
* A JSON Patch that represents updates to the partial result as specified in RFC6902
* https://tools.ietf.org/html/rfc6902
*/
patch: Operation[]
}
/**
* Restriction on vscode's CompletionItem interface
*/
export interface CompletionItem extends vscode.CompletionItem {
data?: CompletionItemData
}
/**
* The necessary fields for a completion item details to be resolved by typescript
*/
export interface CompletionItemData {
/**
* The document from which the completion was requested
*/
uri: string
/**
* The offset into the document at which the completion was requested
*/
offset: number
/**
* The name field from typescript's returned completion entry
*/
entryName: string
}