diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-03 13:54:43 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-03 13:54:43 +0000 |
commit | 5443205fdd9f4886cc88ad15c3a6061ffa90ca19 (patch) | |
tree | 380084b87b5b6b9174f0a8eb6a7652942e862e23 /crates/ra_lsp_server/tests | |
parent | aea2183799e7975d3d9000cec9bb9a3c001a3d4e (diff) | |
parent | 7d9e02e5a201fe997f98b6908daadd820d4a6593 (diff) |
Merge #415
415: use LSP file system operations r=matklad a=vemoo
implements #131
I've replaced `source_file_edits` and `file_system_edits` with `workspace_edit` because [`WorkspacEdit`](https://docs.rs/languageserver-types/0.53.1/languageserver_types/struct.WorkspaceEdit.html) can represent both.
I only use `document_changes` because `changes` cannot represent file system operations.
But if the client doesn't have the `workspace.workspaceEdit.resourceOperations` capability `WorkspaceEdit` cannot replace the current `FileSystemEdit`. Can we assume that the client will support it?
I also adapted the extension code to make use of the new response type, but only for vscode, i don't know if changes have to be made for the emacs part.
Co-authored-by: Bernardo <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/tests')
-rw-r--r-- | crates/ra_lsp_server/tests/heavy_tests/main.rs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs index b0e1e65b6..4cae44eab 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/main.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs | |||
@@ -1,8 +1,12 @@ | |||
1 | mod support; | 1 | mod support; |
2 | 2 | ||
3 | use languageserver_types::{ | ||
4 | CodeActionContext, DocumentFormattingParams, FormattingOptions, Position, Range, | ||
5 | }; | ||
6 | use ra_lsp_server::req::{ | ||
7 | CodeActionParams, CodeActionRequest, Formatting, Runnables, RunnablesParams, | ||
8 | }; | ||
3 | use serde_json::json; | 9 | use serde_json::json; |
4 | use ra_lsp_server::req::{Runnables, RunnablesParams, CodeActionRequest, CodeActionParams, Formatting}; | ||
5 | use languageserver_types::{Position, Range, CodeActionContext, DocumentFormattingParams, FormattingOptions}; | ||
6 | 10 | ||
7 | use crate::support::project; | 11 | use crate::support::project; |
8 | 12 | ||
@@ -203,14 +207,15 @@ fn main() {} | |||
203 | "arguments": [ | 207 | "arguments": [ |
204 | { | 208 | { |
205 | "cursorPosition": null, | 209 | "cursorPosition": null, |
206 | "fileSystemEdits": [ | 210 | "workspaceEdit": { |
207 | { | 211 | "documentChanges": [ |
208 | "type": "createFile", | 212 | { |
213 | "kind": "create", | ||
209 | "uri": "file:///[..]/src/bar.rs" | 214 | "uri": "file:///[..]/src/bar.rs" |
210 | } | 215 | } |
211 | ], | 216 | ] |
212 | "label": "create module", | 217 | }, |
213 | "sourceFileEdits": [] | 218 | "label": "create module" |
214 | } | 219 | } |
215 | ], | 220 | ], |
216 | "command": "ra-lsp.applySourceChange", | 221 | "command": "ra-lsp.applySourceChange", |