about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-05-22 00:28:49 +0200
committerAleksey Kladov <aleksey.kladov@gmail.com>2020-05-22 00:28:49 +0200
commit5ef4ebff2017d7bdfa03f0eccb9960a86c9b94ca (patch)
tree6458549d833ba628fd86d050cb5dd1238c590fc3 /docs
parent59732df8d40dfadc6dcf5951265416576399712a (diff)
downloadrust-5ef4ebff2017d7bdfa03f0eccb9960a86c9b94ca.tar.gz
rust-5ef4ebff2017d7bdfa03f0eccb9960a86c9b94ca.zip
Use WorkspaceEdit for ssr
Diffstat (limited to 'docs')
-rw-r--r--docs/dev/lsp-extensions.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 0e3a0af1cbb..7c45aef4c1a 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -84,3 +84,38 @@ fn main() {
 * What is the position of the cursor after `joinLines`?
   Currently this is left to editor's discretion, but it might be useful to specify on the server via snippets.
   However, it then becomes unclear how it works with multi cursor.
+
+## Structural Search Replace (SSR)
+
+**Server Capability:** `{ "ssr": boolean }`
+
+This request is send from client to server to handle structural search replace -- automated syntax tree based transformation of the source.
+
+**Method:** `experimental/ssr`
+
+**Request:**
+
+```typescript
+interface SsrParams {
+    /// Search query.
+    /// The specific syntax is specified outside of the protocol.
+    query: string,
+    /// If true, only check the syntax of the query and don't compute the actual edit.
+    parseOnly: bool,
+}
+```
+
+**Response:**
+
+```typescript
+WorkspaceEdit
+```
+
+### Example
+
+SSR with query `foo($a:expr, $b:expr) ==>> ($a).foo($b)` will transform, eg `foo(y + 5, z)` into `(y + 5).foo(z)`.
+
+### Unresolved Question
+
+* Probably needs search without replace mode
+* Needs a way to limit the scope to certain files.