mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Added module doc comment to explain the purpose of the completion.
This commit is contained in:
parent
ae8ae650fc
commit
057d0bee55
1 changed files with 32 additions and 1 deletions
|
@ -1,4 +1,35 @@
|
||||||
//! FIXME: write short doc here
|
//! Completion for associated items in a trait implementation.
|
||||||
|
//!
|
||||||
|
//! This module adds the completion items related to implementing associated
|
||||||
|
//! items within a `impl Trait for Struct` block. The current context node
|
||||||
|
//! must be within either a `FN_DEF`, `TYPE_ALIAS_DEF`, or `CONST_DEF` node
|
||||||
|
//! and an direct child of an `IMPL_BLOCK`.
|
||||||
|
//!
|
||||||
|
//! # Examples
|
||||||
|
//!
|
||||||
|
//! Considering the following trait `impl`:
|
||||||
|
//!
|
||||||
|
//! ```ignore
|
||||||
|
//! trait SomeTrait {
|
||||||
|
//! fn foo();
|
||||||
|
//! }
|
||||||
|
//!
|
||||||
|
//! impl SomeTrait for () {
|
||||||
|
//! fn f<|>
|
||||||
|
//! }
|
||||||
|
//! ```
|
||||||
|
//!
|
||||||
|
//! may result in the completion of the following method:
|
||||||
|
//!
|
||||||
|
//! ```ignore
|
||||||
|
//! # trait SomeTrait {
|
||||||
|
//! # fn foo();
|
||||||
|
//! # }
|
||||||
|
//!
|
||||||
|
//! impl SomeTrait for () {
|
||||||
|
//! fn foo() {}<|>
|
||||||
|
//! }
|
||||||
|
//! ```
|
||||||
|
|
||||||
use hir::{self, Docs, HasSource};
|
use hir::{self, Docs, HasSource};
|
||||||
use ra_assists::utils::get_missing_impl_items;
|
use ra_assists::utils::get_missing_impl_items;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue