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.
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
+
exportinterfaceSymbolInfoParams {
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
+
exportinterfaceModuleInfo {
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
+
exportinterfaceSymbolDetails {
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
+
```
390
512
391
513
## `window/logMessage`
392
514
@@ -398,7 +520,7 @@ Added field:
398
520
*
399
521
* Clients may ignore this parameter and add the message to the global log
0 commit comments