Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/semantics/source_to_def.rs')
| -rw-r--r-- | crates/hir/src/semantics/source_to_def.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir/src/semantics/source_to_def.rs b/crates/hir/src/semantics/source_to_def.rs index 3b39a48914..81005f48dd 100644 --- a/crates/hir/src/semantics/source_to_def.rs +++ b/crates/hir/src/semantics/source_to_def.rs @@ -10,7 +10,7 @@ //! This problem is a part of more-or-less every IDE feature implemented. Every //! IDE functionality (like goto to definition), conceptually starts with a //! specific cursor position in a file. Starting with this text offset, we first -//! figure out what syntactic construct are we at: is this a pattern, an +//! figure out what syntactic construct we are at: is this a pattern, an //! expression, an item definition. //! //! Knowing only the syntax gives us relatively little info. For example, @@ -32,11 +32,11 @@ //! Specifically, the algorithm goes like this: //! //! 1. Find the syntactic container for the syntax. For example, field's -//! container is the struct, and structs container is a module. +//! container is the struct, and the struct's container is a module. //! 2. Recursively get the def corresponding to container. //! 3. Ask the container def for all child defs. These child defs contain //! the answer and answer's siblings. -//! 4. For each child def, ask for it's source. +//! 4. For each child def, ask for its source. //! 5. The child def whose source is the syntax node we've started with //! is the answer. //! |