about summary refs log tree commit diff
path: root/docs/dev
diff options
context:
space:
mode:
authordavidsemakula <hello@davidsemakula.com>2024-01-05 01:56:06 +0300
committerdavidsemakula <hello@davidsemakula.com>2024-01-05 01:56:06 +0300
commit7c259a0300b8d59d4c64b9a9ff0fd32f538554ec (patch)
tree1c1e5ad761375c78710c45f0a86497c8dd50d021 /docs/dev
parentf098123122eac28a6f5fbce04340402589e345ae (diff)
fix typos and update descriptions
Diffstat (limited to 'docs/dev')
-rw-r--r--docs/dev/guide.md13
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/dev/guide.md b/docs/dev/guide.md
index 6a1bfea75ef..bb77aa0eaae 100644
--- a/docs/dev/guide.md
+++ b/docs/dev/guide.md
@@ -74,8 +74,8 @@ to study its methods to understand all the input data.
 [`Change`]: https://github.com/rust-lang/rust-analyzer/blob/2024-01-01/crates/hir-expand/src/change.rs#L10-L42
 [`FileChange`]: https://github.com/rust-lang/rust-analyzer/blob/2024-01-01/crates/base-db/src/change.rs#L14-L78
 
-The `change_file` methods controls the set of the input files, where each file
-has an integer id (`FileId`, picked by the client), text (`Option<Arc<str>>`).
+The `change_file` method controls the set of the input files, where each file
+has an integer id (`FileId`, picked by the client) and text (`Option<Arc<str>>`).
 Paths are tricky; they'll be explained below, in source roots section, 
 together with the `set_roots` method. The "source root" [`is_library`] flag
 along with the concept of [`durability`] allows us to add a group of files which 
@@ -397,7 +397,7 @@ the `foo` function of the `bar` `impl` in the `baz` module").
 
 [`Intern` and `Lookup`] traits allows us to combine the benefits of positional and numeric
 IDs. Implementing both traits effectively creates a bidirectional append-only map
-between locations and integer IDs (typically newtype wrappers of [`salsa::InternId`])
+between locations and integer IDs (typically newtype wrappers for [`salsa::InternId`])
 which can "intern" a location and return an integer ID back. The salsa database we use
 includes a couple of [interners]. How to "garbage collect" unused locations
 is an open question.
@@ -552,9 +552,10 @@ completion] and serialize results into the LSP.
 The [completion implementation] is finally the place where we start doing the actual
 work. The first step is to collect the [`CompletionContext`] -- a struct which
 describes the cursor position in terms of Rust syntax and semantics. For
-example, `function_syntax: Option<&'a ast::FnDef>` stores a reference to
-the enclosing function *syntax*, while `function: Option<hir::Function>` is the
-`Def` for this function.
+example, `expected_name: Option<NameOrNameRef>` is the syntactic representation
+for the expected name of what we're completing (usually the parameter name of
+a function argument), while `expected_type: Option<Type>` is the semantic model
+for the expected type of what we're completing.
 
 To construct the context, we first do an ["IntelliJ Trick"]: we insert a dummy
 identifier at the cursor's position and parse this modified file, to get a