diff options
author | Aleksey Kladov <[email protected]> | 2019-01-19 20:06:33 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-21 08:27:01 +0000 |
commit | 6789e5a6e788c06ab4605bf642b545243ee9ae7d (patch) | |
tree | c525cffd8ddde306e68ba1d457dbdb1546f94076 | |
parent | 11bdb7835ffa4a7a3ceee7cddb0ba4696fc652f4 (diff) |
start completions walkthrough
-rw-r--r-- | guide.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -515,3 +515,15 @@ construct a mapping from `ExprId`s to types. | |||
515 | [type-inference]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/ty.rs#L1208-L1223 | 515 | [type-inference]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/ty.rs#L1208-L1223 |
516 | 516 | ||
517 | ## Tying it all together: completion | 517 | ## Tying it all together: completion |
518 | |||
519 | To conclude the overview of the rust analyzer, let's trace the request for | ||
520 | (type-inference powered!) code completion! | ||
521 | |||
522 | We start by [receiving a message] from the language client. We decode the | ||
523 | message as a request for completion and [schedule it on the threadpool]. This is | ||
524 | the place where we [catch] canceled error if, immediately after completion, the | ||
525 | client sends some modification. | ||
526 | |||
527 | [receiving a message]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L203 | ||
528 | [schedule it on the threadpool]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L428 | ||
529 | [catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442 | ||