@@ -105,6 +105,21 @@ type GitBlobLSIFData implements TreeEntryLSIFData {
105
105
"""
106
106
character : Int !
107
107
108
+ """
109
+ When specified, indicates that this request should be paginated and
110
+ to fetch results starting at this cursor.
111
+ A future request can be made for more results by passing in the
112
+ 'LocationConnection.pageInfo.endCursor' that is returned.
113
+ """
114
+ after : String
115
+
116
+ """
117
+ When specified, indicates that this request should be paginated and
118
+ the first N results (relative to the cursor) should be returned. i.e.
119
+ how many results to return per page.
120
+ """
121
+ first : Int
122
+
108
123
"""
109
124
When specified, it filters references by filename.
110
125
"""
@@ -118,12 +133,12 @@ type GitBlobLSIFData implements TreeEntryLSIFData {
118
133
"""
119
134
The line on which the symbol occurs (zero-based, inclusive).
120
135
"""
121
- line : Int !
136
+ line : Int
122
137
123
138
"""
124
139
The character (not byte) of the start line on which the symbol occurs (zero-based, inclusive).
125
140
"""
126
- character : Int !
141
+ character : Int
127
142
128
143
"""
129
144
When specified, indicates that this request should be paginated and
@@ -231,6 +246,19 @@ type GitBlobLSIFData implements TreeEntryLSIFData {
231
246
character : Int !
232
247
): Hover
233
248
249
+ """
250
+ Either one of 'symbol' or 'range' must be provided, but this isn't enforced at the GraphQL
251
+ layer due to the lack of support for input unions.
252
+ https://github.com/graphql/graphql-wg/blob/main/rfcs/InputUnion.md
253
+ """
254
+ usages (
255
+ symbol : LookupSCIPSymbol ,
256
+ range : LookupRange ,
257
+ filter : UsagesFilter ,
258
+ first : Int ,
259
+ after : String ,
260
+ ): UsageConnection !
261
+
234
262
"""
235
263
Code diagnostics provided through LSIF.
236
264
"""
@@ -247,6 +275,77 @@ type GitBlobLSIFData implements TreeEntryLSIFData {
247
275
snapshot (indexID : ID ! ): [SnapshotData ! ]
248
276
}
249
277
278
+ """
279
+ In the future, we may want to extend this to allow passing in a suffix or a "symbol pattern".
280
+ """
281
+ input LookupSCIPSymbol {
282
+ name : String !
283
+ provenance : Provenance !
284
+ }
285
+
286
+ type SCIPSymbol {
287
+ name : String !
288
+ provenance : Provenance !
289
+ }
290
+
291
+ input LookupRange {
292
+ start : LookupPosition !
293
+ end : LookupPosition !
294
+ }
295
+
296
+ input LookupPosition {
297
+ line : Int !
298
+ character : Int !
299
+ }
300
+
301
+ input UsagesFilter {
302
+ and : [UsagesFilter ! ]
303
+ or : [UsagesFilter ! ]
304
+ not : UsagesFilter
305
+ # TODO: Can we be flexible here and allow patterns while still maintaining fast queries.
306
+ repository : String
307
+ path : String
308
+ kind : SymbolUsageKind
309
+ # TODO: Provide a way of controlling fallback behavior for indexes?
310
+ # Not super sure how that would work, given that for different repositories,
311
+ # the hashes will all be different?
312
+ }
313
+
314
+ enum SymbolUsageKind {
315
+ Definition ,
316
+ Reference ,
317
+ Implementation ,
318
+ Super ,
319
+ }
320
+
321
+ type UsageConnection {
322
+ nodes : [Usage ! ]!
323
+ pageInfo : PageInfo !
324
+ }
325
+
326
+ type Usage {
327
+ symbol : SCIPSymbol !
328
+ """
329
+ NOTE: Do not pass
330
+ TODO: For this blob, it is generally more useful to get +N/-N lines
331
+ rather than having to pass a range internally for the contents since
332
+ the offsets from the start will not be known a-priori.
333
+ """
334
+ blob : GitBlob !
335
+ """
336
+ Instead of blob { content }, allows accessing a sub-span of the content
337
+ using relative coordinates from the range of this usage. If linesBefore
338
+ or linesAfter is negative or exceeds the number of available lines,
339
+ the value is interpreted as until the start/end of the file.
340
+ """
341
+ surroundingBlobContent (surroundingLines : SurroundingLines = {linesBefore : 0 , linesAfter : 0 }): String !
342
+ }
343
+
344
+ input SurroundingLines {
345
+ linesBefore : Int
346
+ linesAfter : Int
347
+ }
348
+
250
349
"""
251
350
The SCIP snapshot decoration for a single SCIP Occurrence.
252
351
"""
0 commit comments