Skip to content

Commit 219b11d

Browse files
authored
Merge pull request #1602 from ahoppen/all-todos-must-have-issues
Ensure that all `TODO` and `FIXME` comments have associated issues
2 parents 4a10d3d + 0bb605d commit 219b11d

38 files changed

+298
-204
lines changed

Contributor Documentation/LSP Extensions.md

Lines changed: 156 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -113,37 +113,37 @@ interface WorkspaceBuildSetup {
113113
/**
114114
* The configuration that the workspace should be built in.
115115
*/
116-
buildConfiguration?: BuildConfiguration
116+
buildConfiguration?: BuildConfiguration;
117117

118118
/**
119119
* The default workspace type to use for this workspace.
120120
*/
121-
defaultWorkspaceType?: WorkspaceType
121+
defaultWorkspaceType?: WorkspaceType;
122122

123123
/**
124124
* The build directory for the workspace.
125125
*/
126-
scratchPath?: DocumentURI
126+
scratchPath?: DocumentURI;
127127

128128
/**
129129
* Arguments to be passed to any C compiler invocations.
130130
*/
131-
cFlags?: string[]
131+
cFlags?: string[];
132132

133133
/**
134134
* Arguments to be passed to any C++ compiler invocations.
135135
*/
136-
cxxFlags?: string[]
136+
cxxFlags?: string[];
137137

138138
/**
139139
* Arguments to be passed to any linker invocations.
140140
*/
141-
linkerFlags?: string[]
141+
linkerFlags?: string[];
142142

143143
/**
144144
* Arguments to be passed to any Swift compiler invocations.
145145
*/
146-
swiftFlags?: string[]
146+
swiftFlags?: string[];
147147
}
148148
```
149149
@@ -155,7 +155,7 @@ Added field:
155155
/**
156156
* Options to control code completion behavior in Swift
157157
*/
158-
sourcekitlspOptions?: SKCompletionOptions
158+
sourcekitlspOptions?: SKCompletionOptions;
159159
```
160160
161161
with
@@ -165,7 +165,7 @@ interface SKCompletionOptions {
165165
/**
166166
* The maximum number of completion results to return, or `null` for unlimited.
167167
*/
168-
maxResults?: int
168+
maxResults?: int;
169169
}
170170
```
171171
@@ -190,31 +190,31 @@ export interface SymbolInfoParams {
190190
/**
191191
* The document in which to lookup the symbol location.
192192
*/
193-
textDocument: TextDocumentIdentifier
193+
textDocument: TextDocumentIdentifier;
194194

195195
/**
196196
* The document location at which to lookup symbol information.
197197
*/
198-
position: Position
198+
position: Position;
199199
}
200200

201201
interface ModuleInfo {
202202
/**
203203
* The name of the module in which the symbol is defined.
204204
*/
205-
moduleName: string
205+
moduleName: string;
206206

207207
/**
208208
* If the symbol is defined within a subgroup of a module, the name of the group. Otherwise `nil`.
209209
*/
210-
groupName?: string
210+
groupName?: string;
211211
}
212212

213213
interface SymbolDetails {
214214
/**
215215
* The name of the symbol, if any.
216216
*/
217-
name?: string
217+
name?: string;
218218

219219
/**
220220
* The name of the containing type for the symbol, if any.
@@ -226,12 +226,12 @@ interface SymbolDetails {
226226
* void foo() {}
227227
* }
228228
*/
229-
containerName?: string
229+
containerName?: string;
230230

231231
/**
232232
* The USR of the symbol, if any.
233233
*/
234-
usr?: string
234+
usr?: string;
235235

236236
/**
237237
* Best known declaration or definition location without global knowledge.
@@ -242,27 +242,27 @@ interface SymbolDetails {
242242
* the declaration location from a header as opposed to the definition in some other
243243
* translation unit.
244244
*/
245-
bestLocalDeclaration?: Location
245+
bestLocalDeclaration?: Location;
246246

247247
/**
248248
* The kind of the symbol
249249
*/
250-
kind?: SymbolKind
250+
kind?: SymbolKind;
251251

252252
/**
253253
* Whether the symbol is a dynamic call for which it isn't known which method will be invoked at runtime. This is
254254
* the case for protocol methods and class functions.
255255
*
256256
* Optional because `clangd` does not return whether a symbol is dynamic.
257257
*/
258-
isDynamic?: bool
258+
isDynamic?: bool;
259259

260260
/**
261261
* Whether this symbol is defined in the SDK or standard library.
262262
*
263263
* This property only applies to Swift symbols
264264
*/
265-
isSystem?: bool
265+
isSystem?: bool;
266266

267267
/**
268268
* If the symbol is dynamic, the USRs of the types that might be called.
@@ -289,15 +289,15 @@ interface SymbolDetails {
289289
* receiver USR would be `B`, indicating that only overrides of subtypes in
290290
* `B` may be called dynamically.
291291
*/
292-
receiverUsrs?: string[]
292+
receiverUsrs?: string[];
293293

294294
/**
295295
* If the symbol is defined in a module that doesn't have source information associated with it, the name and group
296296
* and group name that defines this symbol.
297297
*
298298
* This property only applies to Swift symbols.
299299
*/
300-
systemModule?: ModuleInfo
300+
systemModule?: ModuleInfo;
301301
}
302302
```
303303
@@ -313,7 +313,7 @@ interface TestTag {
313313
/**
314314
* ID of the test tag. `TestTag` instances with the same ID are considered to be identical.
315315
*/
316-
id: string
316+
id: string;
317317
}
318318

319319
/**
@@ -329,51 +329,51 @@ interface TestItem {
329329
*
330330
* This identifier uniquely identifies the test case or test suite. It can be used to run an individual test (suite).
331331
*/
332-
id: string
332+
id: string;
333333

334334
/**
335335
* Display name describing the test.
336336
*/
337-
label: string
337+
label: string;
338338

339339
/**
340340
* Optional description that appears next to the label.
341341
*/
342-
description?: string
342+
description?: string;
343343

344344
/**
345345
* A string that should be used when comparing this item with other items.
346346
*
347347
* When `nil` the `label` is used.
348348
*/
349-
sortText?: string
349+
sortText?: string;
350350

351351
/**
352352
* Whether the test is disabled.
353353
*/
354-
disabled: bool
354+
disabled: bool;
355355

356356
/**
357357
* The type of test, eg. the testing framework that was used to declare the test.
358358
*/
359-
style: string
359+
style: string;
360360

361361
/**
362362
* The location of the test item in the source code.
363363
*/
364-
location: Location
364+
location: Location;
365365

366366
/**
367367
* The children of this test item.
368368
*
369369
* For a test suite, this may contain the individual test cases or nested suites.
370370
*/
371-
children: TestItem[]]
371+
children: TestItem[];
372372

373373
/**
374374
* Tags associated with this test item.
375375
*/
376-
tags: TestTag[]
376+
tags: TestTag[];
377377
}
378378

379379
export interface DocumentTestsParams {
@@ -386,7 +386,129 @@ export interface DocumentTestsParams {
386386
387387
## `textDocument/symbolInfo`
388388
389-
TODO
389+
Request for semantic information about the symbol at a given location.
390+
This request looks up the symbol (if any) at a given text document location and returns `SymbolDetails` for that location, including information such as the symbol's USR. The symbolInfo request is not primarily designed for editors, but instead as an implementation detail of how one LSP implementation (e.g. SourceKit) gets information from another (e.g. clangd) to use in performing index queries or otherwise implementing the higher level requests such as definition.
391+
392+
- params: `SymbolInfoParams`
393+
- result: `SymbolDetails[]`
394+
395+
```ts
396+
export interface SymbolInfoParams {
397+
/**
398+
* The document in which to lookup the symbol location.
399+
*/
400+
textDocument: TextDocumentIdentifier;
401+
402+
/**
403+
* The document location at which to lookup symbol information.
404+
*/
405+
position: Position;
406+
}
407+
408+
export interface ModuleInfo {
409+
/**
410+
* The name of the module in which the symbol is defined.
411+
*/
412+
moduleName: string;
413+
414+
/**
415+
* If the symbol is defined within a subgroup of a module, the name of the group. Otherwise `nil`.
416+
*/
417+
groupName?: string;
418+
}
419+
420+
421+
422+
export interface SymbolDetails {
423+
/**
424+
* The name of the symbol, if any.
425+
*/
426+
name?: string;
427+
428+
/**
429+
* The name of the containing type for the symbol, if any.
430+
*
431+
* For example, in the following snippet, the `containerName` of `foo()` is `C`.
432+
*
433+
* ```c++
434+
* class C {
435+
* void foo() {}
436+
* }
437+
* ```
438+
*/
439+
containerName?: string;
440+
441+
/**
442+
* The USR of the symbol, if any.
443+
*/
444+
usr?: string;
445+
446+
/**
447+
* Best known declaration or definition location without global knowledge.
448+
*
449+
* For a local or private variable, this is generally the canonical definition location -
450+
* appropriate as a response to a `textDocument/definition` request. For global symbols this is
451+
* the best known location within a single compilation unit. For example, in C++ this might be
452+
* the declaration location from a header as opposed to the definition in some other
453+
* translation unit.
454+
*/
455+
bestLocalDeclaration?: Location;
456+
457+
/**
458+
* The kind of the symbol
459+
*/
460+
kind?: SymbolKind;
461+
462+
/**
463+
* Whether the symbol is a dynamic call for which it isn't known which method will be invoked at runtime. This is
464+
* the case for protocol methods and class functions.
465+
*
466+
* Optional because `clangd` does not return whether a symbol is dynamic.
467+
*/
468+
isDynamic?: bool;
469+
470+
/**
471+
* Whether this symbol is defined in the SDK or standard library.
472+
*
473+
* This property only applies to Swift symbols.
474+
*/
475+
isSystem?: bool;
476+
477+
/**
478+
* If the symbol is dynamic, the USRs of the types that might be called.
479+
*
480+
* This is relevant in the following cases
481+
* ```swift
482+
* class A {
483+
* func doThing() {}
484+
* }
485+
* class B: A {}
486+
* class C: B {
487+
* override func doThing() {}
488+
* }
489+
* class D: A {
490+
* override func doThing() {}
491+
* }
492+
* func test(value: B) {
493+
* value.doThing()
494+
* }
495+
* ```
496+
*
497+
* The USR of the called function in `value.doThing` is `A.doThing` (or its
498+
* mangled form) but it can never call `D.doThing`. In this case, the
499+
* receiver USR would be `B`, indicating that only overrides of subtypes in
500+
* `B` may be called dynamically.
501+
*/
502+
receiverUsrs?: string[];
503+
504+
/**
505+
* If the symbol is defined in a module that doesn't have source information associated with it, the name and group
506+
* and group name that defines this symbol.
507+
*
508+
* This property only applies to Swift symbols.
509+
*/
510+
systemModule?: ModuleInfo;
511+
```
390512
391513
## `window/logMessage`
392514
@@ -398,7 +520,7 @@ Added field:
398520
*
399521
* Clients may ignore this parameter and add the message to the global log
400522
*/
401-
logName?: string
523+
logName?: string;
402524
```
403525
404526
## `workspace/_pollIndex`

0 commit comments

Comments
 (0)