aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-24 13:46:55 +0100
committerGitHub <[email protected]>2020-07-24 13:46:55 +0100
commitc3defe2532ba6ffd12a13bcbc8fdeda037665efc (patch)
tree831bf4dd44ec83d927face4ba17e57dcdeab7fbe /docs
parent0e5095d3cac11d4b569c6e1594bd07937556c812 (diff)
parent58680cb08ea535e1fb567416fa3466a744a01b99 (diff)
Merge #5518
5518: Use resolved paths in SSR rules r=matklad a=davidlattimore The main user-visible changes are: * SSR now matches paths based on whether they resolve to the same thing instead of whether they're written the same. * So `foo()` won't match `foo()` if it's a different function `foo()`, but will match `bar::foo()` if it's the same `foo`. * Paths in the replacement will now be rendered with appropriate qualification for their context. * For example `foo::Bar` will render as just `Bar` inside the module `foo`, but might render as `baz::foo::Bar` from elsewhere. * This means that all paths in the search pattern and replacement template must be able to be resolved. * It now also matters where you invoke SSR from, since paths are resolved relative to wherever that is. * Search now uses find-uses on paths to locate places to try matching. This means that when a path is present in the pattern, search will generally be pretty fast. * Function calls can now match method calls again, but this time only if they resolve to the same function. Co-authored-by: David Lattimore <[email protected]>
Diffstat (limited to 'docs')
-rw-r--r--docs/dev/lsp-extensions.md7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 98d14450b..1be01fd88 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -274,6 +274,11 @@ interface SsrParams {
274 query: string, 274 query: string,
275 /// If true, only check the syntax of the query and don't compute the actual edit. 275 /// If true, only check the syntax of the query and don't compute the actual edit.
276 parseOnly: bool, 276 parseOnly: bool,
277 /// The current text document. This and `position` will be used to determine in what scope
278 /// paths in `query` should be resolved.
279 textDocument: lc.TextDocumentIdentifier;
280 /// Position where SSR was invoked.
281 position: lc.Position;
277} 282}
278``` 283```
279 284
@@ -285,7 +290,7 @@ WorkspaceEdit
285 290
286### Example 291### Example
287 292
288SSR with query `foo($a:expr, $b:expr) ==>> ($a).foo($b)` will transform, eg `foo(y + 5, z)` into `(y + 5).foo(z)`. 293SSR with query `foo($a, $b) ==>> ($a).foo($b)` will transform, eg `foo(y + 5, z)` into `(y + 5).foo(z)`.
289 294
290### Unresolved Question 295### Unresolved Question
291 296