diff options
author | Kevin DeLorey <[email protected]> | 2020-02-15 16:27:04 +0000 |
---|---|---|
committer | Kevin DeLorey <[email protected]> | 2020-02-15 16:27:04 +0000 |
commit | 057d0bee5516dc7cba71479b27227c5ad22140ee (patch) | |
tree | 2fdfe184dc39145ecf63543c82b5ca8722ec2397 /crates/ra_ide/src | |
parent | ae8ae650fcf8fcdc178fb839b9dbdd67b5864816 (diff) |
Added module doc comment to explain the purpose of the completion.
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r-- | crates/ra_ide/src/completion/complete_trait_impl.rs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index 83b97eb76..6ff10c017 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs | |||
@@ -1,4 +1,35 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Completion for associated items in a trait implementation. |
2 | //! | ||
3 | //! This module adds the completion items related to implementing associated | ||
4 | //! items within a `impl Trait for Struct` block. The current context node | ||
5 | //! must be within either a `FN_DEF`, `TYPE_ALIAS_DEF`, or `CONST_DEF` node | ||
6 | //! and an direct child of an `IMPL_BLOCK`. | ||
7 | //! | ||
8 | //! # Examples | ||
9 | //! | ||
10 | //! Considering the following trait `impl`: | ||
11 | //! | ||
12 | //! ```ignore | ||
13 | //! trait SomeTrait { | ||
14 | //! fn foo(); | ||
15 | //! } | ||
16 | //! | ||
17 | //! impl SomeTrait for () { | ||
18 | //! fn f<|> | ||
19 | //! } | ||
20 | //! ``` | ||
21 | //! | ||
22 | //! may result in the completion of the following method: | ||
23 | //! | ||
24 | //! ```ignore | ||
25 | //! # trait SomeTrait { | ||
26 | //! # fn foo(); | ||
27 | //! # } | ||
28 | //! | ||
29 | //! impl SomeTrait for () { | ||
30 | //! fn foo() {}<|> | ||
31 | //! } | ||
32 | //! ``` | ||
2 | 33 | ||
3 | use hir::{self, Docs, HasSource}; | 34 | use hir::{self, Docs, HasSource}; |
4 | use ra_assists::utils::get_missing_impl_items; | 35 | use ra_assists::utils::get_missing_impl_items; |