From 057d0bee5516dc7cba71479b27227c5ad22140ee Mon Sep 17 00:00:00 2001 From: Kevin DeLorey <2295721+kdelorey@users.noreply.github.com> Date: Sat, 15 Feb 2020 10:27:04 -0600 Subject: Added module doc comment to explain the purpose of the completion. --- .../ra_ide/src/completion/complete_trait_impl.rs | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide') 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 @@ -//! 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 ra_assists::utils::get_missing_impl_items; -- cgit v1.2.3