Skip to content

Commit 057d0be

Browse files
committed
Added module doc comment to explain the purpose of the completion.
1 parent ae8ae65 commit 057d0be

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

crates/ra_ide/src/completion/complete_trait_impl.rs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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+
//! ```
233
334
use hir::{self, Docs, HasSource};
435
use ra_assists::utils::get_missing_impl_items;

0 commit comments

Comments
 (0)