diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-25 15:00:24 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-25 15:00:24 +0100 |
commit | 19700b2e31cf7a92fbf9da0db82a092d9dcaca34 (patch) | |
tree | 06bb2df01d20d94ab38f2216d88555df03a826c9 /docs/dev | |
parent | 00172d0b555d22a42a2cbf8785eb7b2592507c4f (diff) | |
parent | 0ebb25b29b0988be89f42091fd373ea58d7ff9fb (diff) |
Merge #4611
4611: Document `parentModule` experimental LSP request r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'docs/dev')
-rw-r--r-- | docs/dev/lsp-extensions.md | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md index 48147b173..209f470eb 100644 --- a/docs/dev/lsp-extensions.md +++ b/docs/dev/lsp-extensions.md | |||
@@ -87,6 +87,40 @@ Invoking code action at this position will yield two code actions for importing | |||
87 | * Is a fixed two-level structure enough? | 87 | * Is a fixed two-level structure enough? |
88 | * Should we devise a general way to encode custom interaction protocols for GUI refactorings? | 88 | * Should we devise a general way to encode custom interaction protocols for GUI refactorings? |
89 | 89 | ||
90 | ## Parent Module | ||
91 | |||
92 | **Issue:** https://github.com/microsoft/language-server-protocol/issues/1002 | ||
93 | |||
94 | **Server Capability:** `{ "parentModule": boolean }` | ||
95 | |||
96 | This request is send from client to server to handle "Goto Parent Module" editor action. | ||
97 | |||
98 | **Method:** `experimental/parentModule` | ||
99 | |||
100 | **Request:** `TextDocumentPositionParams` | ||
101 | |||
102 | **Response:** `Location | Location[] | LocationLink[] | null` | ||
103 | |||
104 | |||
105 | ### Example | ||
106 | |||
107 | ```rust | ||
108 | // src/main.rs | ||
109 | mod foo; | ||
110 | // src/foo.rs | ||
111 | |||
112 | /* cursor here*/ | ||
113 | ``` | ||
114 | |||
115 | `experimental/parentModule` returns a single `Link` to the `mod foo;` declaration. | ||
116 | |||
117 | ### Unresolved Question | ||
118 | |||
119 | * An alternative would be to use a more general "gotoSuper" request, which would work for super methods, super classes and super modules. | ||
120 | This is the approach IntelliJ Rust is takeing. | ||
121 | However, experience shows that super module (which generally has a feeling of navigation between files) should be separate. | ||
122 | If you want super module, but the cursor happens to be inside an overriden function, the behavior with single "gotoSuper" request is surprising. | ||
123 | |||
90 | ## Join Lines | 124 | ## Join Lines |
91 | 125 | ||
92 | **Issue:** https://github.com/microsoft/language-server-protocol/issues/992 | 126 | **Issue:** https://github.com/microsoft/language-server-protocol/issues/992 |
@@ -108,11 +142,7 @@ interface JoinLinesParams { | |||
108 | } | 142 | } |
109 | ``` | 143 | ``` |
110 | 144 | ||
111 | **Response:** | 145 | **Response:** `TextEdit[]` |
112 | |||
113 | ```typescript | ||
114 | TextEdit[] | ||
115 | ``` | ||
116 | 146 | ||
117 | ### Example | 147 | ### Example |
118 | 148 | ||