Skip to content

Commit 4cb8a56

Browse files
authored
Merge pull request #1987 from ahoppen/lsp-extensions-sort
Sort requests in `LSP Extensions.md` alphabetically
2 parents e865120 + 5f64cf0 commit 4cb8a56

File tree

1 file changed

+37
-163
lines changed

1 file changed

+37
-163
lines changed

Contributor Documentation/LSP Extensions.md

Lines changed: 37 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export interface DoccDocumentationParams {
204204

205205
/**
206206
* The cursor position within the document. (optional)
207-
*
207+
*
208208
* This parameter is only used in Swift files to determine which symbol to render.
209209
* The position is ignored for markdown and tutorial documents.
210210
*/
@@ -434,132 +434,6 @@ export interface DocumentTestsParams {
434434
}
435435
```
436436
437-
## `textDocument/symbolInfo`
438-
439-
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-
export interface SymbolInfoParams {
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-
export interface ModuleInfo {
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-
export interface SymbolDetails {
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-
563437
## `window/logMessage`
564438
565439
Added field:
@@ -584,29 +458,31 @@ New request to wait until the index is up-to-date.
584458
export interface PollIndexParams {}
585459
```
586460
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-
export interface WorkspaceTestsParams {}
596-
```
597-
598-
## `workspace/triggerReindex`
461+
## `workspace/getReferenceDocument`
599462
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:"
601465
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.
603467
468+
- params: `GetReferenceDocumentParams`
604469
605-
- params: `TriggerReindexParams`
606-
- result: `void`
470+
- result: `GetReferenceDocumentResponse`
607471
608472
```ts
609-
export interface TriggerReindexParams {}
473+
export interface GetReferenceDocumentParams {
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`
482+
*/
483+
export interface GetReferenceDocumentResult {
484+
content: string;
485+
}
610486
```
611487
612488
## `workspace/peekDocuments`
@@ -646,31 +522,29 @@ export interface PeekDocumentsResult {
646522
}
647523
```
648524
649-
## `workspace/getReferenceDocument`
525+
## `workspace/tests`
650526
651-
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.
653528
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[]`
655531
656-
- params: `GetReferenceDocumentParams`
532+
```ts
533+
export interface WorkspaceTestsParams {}
534+
```
657535
658-
- result: `GetReferenceDocumentResponse`
536+
## `workspace/triggerReindex`
659537
660-
```ts
661-
export interface GetReferenceDocumentParams {
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.
667539
668-
/**
669-
* Response containing `content` of `GetReferenceDocumentRequest`
670-
*/
671-
export interface GetReferenceDocumentResult {
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.
541+
542+
543+
- params: `TriggerReindexParams`
544+
- result: `void`
545+
546+
```ts
547+
export interface TriggerReindexParams {}
674548
```
675549
676550
## Languages

0 commit comments

Comments
 (0)