-
Notifications
You must be signed in to change notification settings - Fork 5
/
aliases.scala
394 lines (331 loc) · 16.6 KB
/
aliases.scala
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
/*
* Copyright 2022 Neandertech
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package langoustine.lsp
import langoustine.*
import json.{*, given}
import runtime.{*, given}
import upickle.default.*
import scala.reflect.*
// format: off
object aliases:
opaque type ChangeAnnotationIdentifier = String
object ChangeAnnotationIdentifier extends codecs.aliases_ChangeAnnotationIdentifier:
inline def apply(v: String): ChangeAnnotationIdentifier = v
given Typeable[ChangeAnnotationIdentifier] with
def unapply(s: Any): Option[s.type & ChangeAnnotationIdentifier] =
s match
case c: String => Some(c.asInstanceOf[s.type & String])
case _ => Option.empty
opaque type Declaration = (structures.Location | Vector[structures.Location])
object Declaration extends codecs.aliases_Declaration:
inline def apply(v: structures.Location): Declaration = v
inline def apply(v: Vector[structures.Location]): Declaration = v
given Typeable[Declaration] with
def unapply(s: Any): Option[s.type & Declaration] =
s match
case c: structures.Location => Some(c.asInstanceOf[s.type & structures.Location])
case c: Vector[?] => Some(c.asInstanceOf[s.type & Vector[structures.Location]])
case _ => Option.empty
opaque type DeclarationLink = structures.LocationLink
object DeclarationLink extends codecs.aliases_DeclarationLink:
inline def apply(v: structures.LocationLink): DeclarationLink = v
given Typeable[DeclarationLink] with
def unapply(s: Any): Option[s.type & DeclarationLink] =
s match
case c: structures.LocationLink => Some(c.asInstanceOf[s.type & structures.LocationLink])
case _ => Option.empty
opaque type Definition = (structures.Location | Vector[structures.Location])
object Definition extends codecs.aliases_Definition:
inline def apply(v: structures.Location): Definition = v
inline def apply(v: Vector[structures.Location]): Definition = v
given Typeable[Definition] with
def unapply(s: Any): Option[s.type & Definition] =
s match
case c: structures.Location => Some(c.asInstanceOf[s.type & structures.Location])
case c: Vector[?] => Some(c.asInstanceOf[s.type & Vector[structures.Location]])
case _ => Option.empty
opaque type DefinitionLink = structures.LocationLink
object DefinitionLink extends codecs.aliases_DefinitionLink:
inline def apply(v: structures.LocationLink): DefinitionLink = v
given Typeable[DefinitionLink] with
def unapply(s: Any): Option[s.type & DefinitionLink] =
s match
case c: structures.LocationLink => Some(c.asInstanceOf[s.type & structures.LocationLink])
case _ => Option.empty
opaque type DocumentDiagnosticReport = (structures.RelatedFullDocumentDiagnosticReport | structures.RelatedUnchangedDocumentDiagnosticReport)
object DocumentDiagnosticReport extends codecs.aliases_DocumentDiagnosticReport:
inline def apply(v: structures.RelatedFullDocumentDiagnosticReport): DocumentDiagnosticReport = v
inline def apply(v: structures.RelatedUnchangedDocumentDiagnosticReport): DocumentDiagnosticReport = v
given Typeable[DocumentDiagnosticReport] with
def unapply(s: Any): Option[s.type & DocumentDiagnosticReport] =
s match
case c: structures.RelatedFullDocumentDiagnosticReport => Some(c.asInstanceOf[s.type & structures.RelatedFullDocumentDiagnosticReport])
case c: structures.RelatedUnchangedDocumentDiagnosticReport => Some(c.asInstanceOf[s.type & structures.RelatedUnchangedDocumentDiagnosticReport])
case _ => Option.empty
opaque type DocumentFilter = (aliases.TextDocumentFilter | structures.NotebookCellTextDocumentFilter)
object DocumentFilter extends codecs.aliases_DocumentFilter:
inline def apply(v: aliases.TextDocumentFilter): DocumentFilter = v
inline def apply(v: structures.NotebookCellTextDocumentFilter): DocumentFilter = v
given Typeable[DocumentFilter] with
def unapply(s: Any): Option[s.type & DocumentFilter] =
s match
case c: aliases.TextDocumentFilter => Some(c.asInstanceOf[s.type & aliases.TextDocumentFilter])
case c: structures.NotebookCellTextDocumentFilter => Some(c.asInstanceOf[s.type & structures.NotebookCellTextDocumentFilter])
case _ => Option.empty
opaque type DocumentSelector = Vector[aliases.DocumentFilter]
object DocumentSelector extends codecs.aliases_DocumentSelector:
inline def apply(v: Vector[aliases.DocumentFilter]): DocumentSelector = v
given Typeable[DocumentSelector] with
def unapply(s: Any): Option[s.type & DocumentSelector] =
s match
case c: Vector[?] => Some(c.asInstanceOf[s.type & Vector[aliases.DocumentFilter]])
case _ => Option.empty
opaque type GlobPattern = (aliases.Pattern | structures.RelativePattern)
object GlobPattern extends codecs.aliases_GlobPattern:
inline def apply(v: aliases.Pattern): GlobPattern = v
inline def apply(v: structures.RelativePattern): GlobPattern = v
given Typeable[GlobPattern] with
def unapply(s: Any): Option[s.type & GlobPattern] =
s match
case c: aliases.Pattern => Some(c.asInstanceOf[s.type & aliases.Pattern])
case c: structures.RelativePattern => Some(c.asInstanceOf[s.type & structures.RelativePattern])
case _ => Option.empty
opaque type InlineValue = (structures.InlineValueText | structures.InlineValueVariableLookup | structures.InlineValueEvaluatableExpression)
object InlineValue extends codecs.aliases_InlineValue:
inline def apply(v: structures.InlineValueText): InlineValue = v
inline def apply(v: structures.InlineValueVariableLookup): InlineValue = v
inline def apply(v: structures.InlineValueEvaluatableExpression): InlineValue = v
given Typeable[InlineValue] with
def unapply(s: Any): Option[s.type & InlineValue] =
s match
case c: structures.InlineValueText => Some(c.asInstanceOf[s.type & structures.InlineValueText])
case c: structures.InlineValueVariableLookup => Some(c.asInstanceOf[s.type & structures.InlineValueVariableLookup])
case c: structures.InlineValueEvaluatableExpression => Some(c.asInstanceOf[s.type & structures.InlineValueEvaluatableExpression])
case _ => Option.empty
opaque type LSPObject = Map[String, ujson.Value]
object LSPObject extends codecs.aliases_LSPObject:
inline def apply(v: Map[String, ujson.Value]): LSPObject = v
given Typeable[LSPObject] with
def unapply(s: Any): Option[s.type & LSPObject] =
s match
case c: Map[String, ujson.Value] => Some(c.asInstanceOf[s.type & Map[String, ujson.Value]])
case _ => Option.empty
opaque type MarkedString = (String | MarkedString.S0)
object MarkedString extends codecs.aliases_MarkedString:
inline def apply(v: String): MarkedString = v
inline def apply(v: MarkedString.S0): MarkedString = v
given Typeable[MarkedString] with
def unapply(s: Any): Option[s.type & MarkedString] =
s match
case c: String => Some(c.asInstanceOf[s.type & String])
case c: MarkedString.S0 => Some(c.asInstanceOf[s.type & MarkedString.S0])
case _ => Option.empty
case class S0(
language: String,
value: String
)
object S0 extends codecs.aliases_MarkedString_S0Codec
opaque type NotebookDocumentFilter = (NotebookDocumentFilter.S0 | NotebookDocumentFilter.S1 | NotebookDocumentFilter.S2)
object NotebookDocumentFilter extends codecs.aliases_NotebookDocumentFilter:
inline def apply(v: NotebookDocumentFilter.S0): NotebookDocumentFilter = v
inline def apply(v: NotebookDocumentFilter.S1): NotebookDocumentFilter = v
inline def apply(v: NotebookDocumentFilter.S2): NotebookDocumentFilter = v
given Typeable[NotebookDocumentFilter] with
def unapply(s: Any): Option[s.type & NotebookDocumentFilter] =
s match
case c: NotebookDocumentFilter.S0 => Some(c.asInstanceOf[s.type & NotebookDocumentFilter.S0])
case c: NotebookDocumentFilter.S1 => Some(c.asInstanceOf[s.type & NotebookDocumentFilter.S1])
case c: NotebookDocumentFilter.S2 => Some(c.asInstanceOf[s.type & NotebookDocumentFilter.S2])
case _ => Option.empty
/**
* @param notebookType
* The type of the enclosing notebook.
* @param scheme
* A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
* @param pattern
* A glob pattern.
*/
case class S0(
notebookType: String,
scheme: Opt[String] = Opt.empty,
pattern: Opt[String] = Opt.empty
)
object S0 extends codecs.aliases_NotebookDocumentFilter_S0Codec
/**
* @param notebookType
* The type of the enclosing notebook.
* @param scheme
* A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
* @param pattern
* A glob pattern.
*/
case class S1(
notebookType: Opt[String] = Opt.empty,
scheme: String,
pattern: Opt[String] = Opt.empty
)
object S1 extends codecs.aliases_NotebookDocumentFilter_S1Codec
/**
* @param notebookType
* The type of the enclosing notebook.
* @param scheme
* A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
* @param pattern
* A glob pattern.
*/
case class S2(
notebookType: Opt[String] = Opt.empty,
scheme: Opt[String] = Opt.empty,
pattern: String
)
object S2 extends codecs.aliases_NotebookDocumentFilter_S2Codec
opaque type Pattern = String
object Pattern extends codecs.aliases_Pattern:
inline def apply(v: String): Pattern = v
given Typeable[Pattern] with
def unapply(s: Any): Option[s.type & Pattern] =
s match
case c: String => Some(c.asInstanceOf[s.type & String])
case _ => Option.empty
opaque type PrepareRenameResult = (structures.Range | PrepareRenameResult.S0 | PrepareRenameResult.S1)
object PrepareRenameResult extends codecs.aliases_PrepareRenameResult:
inline def apply(v: structures.Range): PrepareRenameResult = v
inline def apply(v: PrepareRenameResult.S0): PrepareRenameResult = v
inline def apply(v: PrepareRenameResult.S1): PrepareRenameResult = v
given Typeable[PrepareRenameResult] with
def unapply(s: Any): Option[s.type & PrepareRenameResult] =
s match
case c: structures.Range => Some(c.asInstanceOf[s.type & structures.Range])
case c: PrepareRenameResult.S0 => Some(c.asInstanceOf[s.type & PrepareRenameResult.S0])
case c: PrepareRenameResult.S1 => Some(c.asInstanceOf[s.type & PrepareRenameResult.S1])
case _ => Option.empty
case class S0(
range: structures.Range,
placeholder: String
)
object S0 extends codecs.aliases_PrepareRenameResult_S0Codec
case class S1(
defaultBehavior: Boolean
)
object S1 extends codecs.aliases_PrepareRenameResult_S1Codec
opaque type ProgressToken = (Int | String)
object ProgressToken extends codecs.aliases_ProgressToken:
inline def apply(v: Int): ProgressToken = v
inline def apply(v: String): ProgressToken = v
given Typeable[ProgressToken] with
def unapply(s: Any): Option[s.type & ProgressToken] =
s match
case c: Int => Some(c.asInstanceOf[s.type & Int])
case c: String => Some(c.asInstanceOf[s.type & String])
case _ => Option.empty
opaque type TextDocumentContentChangeEvent = (TextDocumentContentChangeEvent.S0 | TextDocumentContentChangeEvent.S1)
object TextDocumentContentChangeEvent extends codecs.aliases_TextDocumentContentChangeEvent:
inline def apply(v: TextDocumentContentChangeEvent.S0): TextDocumentContentChangeEvent = v
inline def apply(v: TextDocumentContentChangeEvent.S1): TextDocumentContentChangeEvent = v
given Typeable[TextDocumentContentChangeEvent] with
def unapply(s: Any): Option[s.type & TextDocumentContentChangeEvent] =
s match
case c: TextDocumentContentChangeEvent.S0 => Some(c.asInstanceOf[s.type & TextDocumentContentChangeEvent.S0])
case c: TextDocumentContentChangeEvent.S1 => Some(c.asInstanceOf[s.type & TextDocumentContentChangeEvent.S1])
case _ => Option.empty
/**
* @param range
* The range of the document that changed.
* @param rangeLength
* The optional length of the range that got replaced.
*
* @deprecated use range instead.
* @param text
* The new text for the provided range.
*/
case class S0(
range: structures.Range,
rangeLength: Opt[runtime.uinteger] = Opt.empty,
text: String
)
object S0 extends codecs.aliases_TextDocumentContentChangeEvent_S0Codec
/**
* @param text
* The new text of the whole document.
*/
case class S1(
text: String
)
object S1 extends codecs.aliases_TextDocumentContentChangeEvent_S1Codec
opaque type TextDocumentFilter = (TextDocumentFilter.S0 | TextDocumentFilter.S1 | TextDocumentFilter.S2)
object TextDocumentFilter extends codecs.aliases_TextDocumentFilter:
inline def apply(v: TextDocumentFilter.S0): TextDocumentFilter = v
inline def apply(v: TextDocumentFilter.S1): TextDocumentFilter = v
inline def apply(v: TextDocumentFilter.S2): TextDocumentFilter = v
given Typeable[TextDocumentFilter] with
def unapply(s: Any): Option[s.type & TextDocumentFilter] =
s match
case c: TextDocumentFilter.S0 => Some(c.asInstanceOf[s.type & TextDocumentFilter.S0])
case c: TextDocumentFilter.S1 => Some(c.asInstanceOf[s.type & TextDocumentFilter.S1])
case c: TextDocumentFilter.S2 => Some(c.asInstanceOf[s.type & TextDocumentFilter.S2])
case _ => Option.empty
/**
* @param language
* A language id, like `typescript`.
* @param scheme
* A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
* @param pattern
* A glob pattern, like **.{ts,js}. See TextDocumentFilter for examples.
*/
case class S0(
language: String,
scheme: Opt[String] = Opt.empty,
pattern: Opt[String] = Opt.empty
)
object S0 extends codecs.aliases_TextDocumentFilter_S0Codec
/**
* @param language
* A language id, like `typescript`.
* @param scheme
* A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
* @param pattern
* A glob pattern, like **.{ts,js}. See TextDocumentFilter for examples.
*/
case class S1(
language: Opt[String] = Opt.empty,
scheme: String,
pattern: Opt[String] = Opt.empty
)
object S1 extends codecs.aliases_TextDocumentFilter_S1Codec
/**
* @param language
* A language id, like `typescript`.
* @param scheme
* A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
* @param pattern
* A glob pattern, like **.{ts,js}. See TextDocumentFilter for examples.
*/
case class S2(
language: Opt[String] = Opt.empty,
scheme: Opt[String] = Opt.empty,
pattern: String
)
object S2 extends codecs.aliases_TextDocumentFilter_S2Codec
opaque type WorkspaceDocumentDiagnosticReport = (structures.WorkspaceFullDocumentDiagnosticReport | structures.WorkspaceUnchangedDocumentDiagnosticReport)
object WorkspaceDocumentDiagnosticReport extends codecs.aliases_WorkspaceDocumentDiagnosticReport:
inline def apply(v: structures.WorkspaceFullDocumentDiagnosticReport): WorkspaceDocumentDiagnosticReport = v
inline def apply(v: structures.WorkspaceUnchangedDocumentDiagnosticReport): WorkspaceDocumentDiagnosticReport = v
given Typeable[WorkspaceDocumentDiagnosticReport] with
def unapply(s: Any): Option[s.type & WorkspaceDocumentDiagnosticReport] =
s match
case c: structures.WorkspaceFullDocumentDiagnosticReport => Some(c.asInstanceOf[s.type & structures.WorkspaceFullDocumentDiagnosticReport])
case c: structures.WorkspaceUnchangedDocumentDiagnosticReport => Some(c.asInstanceOf[s.type & structures.WorkspaceUnchangedDocumentDiagnosticReport])
case _ => Option.empty