From 6789e5a6e788c06ab4605bf642b545243ee9ae7d Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Sat, 19 Jan 2019 23:06:33 +0300
Subject: start completions walkthrough

---
 guide.md | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/guide.md b/guide.md
index f8286f6fa..f0a2d60b8 100644
--- a/guide.md
+++ b/guide.md
@@ -515,3 +515,15 @@ construct a mapping from `ExprId`s to types.
 [type-inference]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/ty.rs#L1208-L1223
 
 ## Tying it all together: completion
+
+To conclude the overview of the rust analyzer, let's trace the request for
+(type-inference powered!) code completion!
+
+We start by [receiving a message] from the language client. We decode the
+message as a request for completion and [schedule it on the threadpool]. This is
+the place where we [catch] canceled error if, immediately after completion, the
+client sends some modification.
+
+[receiving a message]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L203
+[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
+[catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442
-- 
cgit v1.2.3