You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Request for semantic information about the symbol at a given location.
440
-
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.
441
-
442
-
- params: `SymbolInfoParams`
443
-
- result: `SymbolDetails[]`
444
-
445
-
```ts
446
-
exportinterfaceSymbolInfoParams {
447
-
/**
448
-
* The document in which to lookup the symbol location.
449
-
*/
450
-
textDocument: TextDocumentIdentifier;
451
-
452
-
/**
453
-
* The document location at which to lookup symbol information.
454
-
*/
455
-
position: Position;
456
-
}
457
-
458
-
exportinterfaceModuleInfo {
459
-
/**
460
-
* The name of the module in which the symbol is defined.
461
-
*/
462
-
moduleName: string;
463
-
464
-
/**
465
-
* If the symbol is defined within a subgroup of a module, the name of the group. Otherwise `nil`.
466
-
*/
467
-
groupName?:string;
468
-
}
469
-
470
-
471
-
472
-
exportinterfaceSymbolDetails {
473
-
/**
474
-
* The name of the symbol, if any.
475
-
*/
476
-
name?: string;
477
-
478
-
/**
479
-
* The name of the containing type for the symbol, if any.
480
-
*
481
-
* For example, in the following snippet, the `containerName` of `foo()` is `C`.
482
-
*
483
-
* ```c++
484
-
* class C {
485
-
* void foo() {}
486
-
* }
487
-
* ```
488
-
*/
489
-
containerName?:string;
490
-
491
-
/**
492
-
* The USR of the symbol, if any.
493
-
*/
494
-
usr?:string;
495
-
496
-
/**
497
-
* Best known declaration or definition location without global knowledge.
498
-
*
499
-
* For a local or private variable, this is generally the canonical definition location -
500
-
* appropriate as a response to a `textDocument/definition` request. For global symbols this is
501
-
* the best known location within a single compilation unit. For example, in C++ this might be
502
-
* the declaration location from a header as opposed to the definition in some other
503
-
* translation unit.
504
-
*/
505
-
bestLocalDeclaration?:Location;
506
-
507
-
/**
508
-
* The kind of the symbol
509
-
*/
510
-
kind?:SymbolKind;
511
-
512
-
/**
513
-
* Whether the symbol is a dynamic call for which it isn't known which method will be invoked at runtime. This is
514
-
* the case for protocol methods and class functions.
515
-
*
516
-
* Optional because `clangd` does not return whether a symbol is dynamic.
517
-
*/
518
-
isDynamic?:bool;
519
-
520
-
/**
521
-
* Whether this symbol is defined in the SDK or standard library.
522
-
*
523
-
* This property only applies to Swift symbols.
524
-
*/
525
-
isSystem?:bool;
526
-
527
-
/**
528
-
* If the symbol is dynamic, the USRs of the types that might be called.
529
-
*
530
-
* This is relevant in the following cases
531
-
* ```swift
532
-
* class A {
533
-
* func doThing() {}
534
-
* }
535
-
* class B: A {}
536
-
* class C: B {
537
-
* override func doThing() {}
538
-
* }
539
-
* class D: A {
540
-
* override func doThing() {}
541
-
* }
542
-
* func test(value: B) {
543
-
* value.doThing()
544
-
* }
545
-
* ```
546
-
*
547
-
* The USR of the called function in `value.doThing` is `A.doThing` (or its
548
-
* mangled form) but it can never call `D.doThing`. In this case, the
549
-
* receiver USR would be `B`, indicating that only overrides of subtypes in
550
-
* `B` may be called dynamically.
551
-
*/
552
-
receiverUsrs?:string[];
553
-
554
-
/**
555
-
* If the symbol is defined in a module that doesn't have source information associated with it, the name and group
556
-
* and group name that defines this symbol.
557
-
*
558
-
* This property only applies to Swift symbols.
559
-
*/
560
-
systemModule?:ModuleInfo;
561
-
```
562
-
563
437
## `window/logMessage`
564
438
565
439
Added field:
@@ -584,29 +458,31 @@ New request to wait until the index is up-to-date.
584
458
exportinterfacePollIndexParams {}
585
459
```
586
460
587
-
## `workspace/tests`
588
-
589
-
New request that returns symbols for all the test classes and test methods within the current workspace.
590
-
591
-
- params: `WorkspaceTestsParams`
592
-
- result: `TestItem[]`
593
-
594
-
```ts
595
-
exportinterfaceWorkspaceTestsParams {}
596
-
```
597
-
598
-
## `workspace/triggerReindex`
461
+
## `workspace/getReferenceDocument`
599
462
600
-
New request to re-index all files open in the SourceKit-LSP server.
463
+
Request from the client to the server asking for contents of a URI having a custom scheme.
464
+
For example: "sourcekit-lsp:"
601
465
602
-
Users should not need to rely on this request. The index should always be updated automatically in the background. Having to invoke this request means there is a bug in SourceKit-LSP's automatic re-indexing. It does, however, offer a workaround to re-index files when such a bug occurs where otherwise there would be no workaround.
466
+
Enable the experimental client capability `"workspace/getReferenceDocument"` so that the server responds with reference document URLs for certain requests or commands whenever possible.
603
467
468
+
- params: `GetReferenceDocumentParams`
604
469
605
-
- params: `TriggerReindexParams`
606
-
- result: `void`
470
+
- result: `GetReferenceDocumentResponse`
607
471
608
472
```ts
609
-
exportinterfaceTriggerReindexParams {}
473
+
exportinterfaceGetReferenceDocumentParams {
474
+
/**
475
+
* The `DocumentUri` of the custom scheme url for which content is required
476
+
*/
477
+
uri: DocumentUri;
478
+
}
479
+
480
+
/**
481
+
* Response containing `content` of `GetReferenceDocumentRequest`
Request from the client to the server asking for contents of a URI having a custom scheme.
652
-
For example: "sourcekit-lsp:"
527
+
New request that returns symbols for all the test classes and test methods within the current workspace.
653
528
654
-
Enable the experimental client capability `"workspace/getReferenceDocument"` so that the server responds with reference document URLs for certain requests or commands whenever possible.
529
+
- params: `WorkspaceTestsParams`
530
+
- result: `TestItem[]`
655
531
656
-
- params: `GetReferenceDocumentParams`
532
+
```ts
533
+
exportinterfaceWorkspaceTestsParams {}
534
+
```
657
535
658
-
- result: `GetReferenceDocumentResponse`
536
+
## `workspace/triggerReindex`
659
537
660
-
```ts
661
-
exportinterfaceGetReferenceDocumentParams {
662
-
/**
663
-
* The `DocumentUri` of the custom scheme url for which content is required
664
-
*/
665
-
uri: DocumentUri;
666
-
}
538
+
New request to re-index all files open in the SourceKit-LSP server.
667
539
668
-
/**
669
-
* Response containing `content` of `GetReferenceDocumentRequest`
670
-
*/
671
-
exportinterfaceGetReferenceDocumentResult {
672
-
content: string;
673
-
}
540
+
Users should not need to rely on this request. The index should always be updated automatically in the background. Having to invoke this request means there is a bug in SourceKit-LSP's automatic re-indexing. It does, however, offer a workaround to re-index files when such a bug occurs where otherwise there would be no workaround.
0 commit comments