File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed
crates/ra_ide/src/completion Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change 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+ //! ```
233
334use hir:: { self , Docs , HasSource } ;
435use ra_assists:: utils:: get_missing_impl_items;
You can’t perform that action at this time.
0 commit comments