Skip to content

Commit 2a214e1

Browse files
committed
Add doc-comments to the new files
1 parent af7175f commit 2a214e1

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

crates/completion/src/render.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ pub(crate) use crate::render::{
2323
macro_::MacroRender, type_alias::TypeAliasRender,
2424
};
2525

26+
/// Generic renderer for completion items.
2627
#[derive(Debug)]
2728
pub(crate) struct Render<'a> {
2829
ctx: RenderContext<'a>,
2930
}
3031

32+
/// Interface for data and methods required for items rendering.
3133
#[derive(Debug)]
3234
pub(crate) struct RenderContext<'a> {
3335
completion: &'a CompletionContext<'a>,

crates/completion/src/render/const_.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Renderer for `const` fields.
2+
13
use hir::HasSource;
24
use syntax::{
35
ast::{Const, NameOwner},

crates/completion/src/render/enum_variant.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Renderer for `enum` variants.
2+
13
use hir::{HasAttrs, HirDisplay, ModPath, StructKind};
24
use itertools::Itertools;
35
use test_utils::mark;

crates/completion/src/render/function.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Renderer for function calls.
2+
13
use hir::{HasSource, Type};
24
use syntax::{ast::Fn, display::function_declaration};
35

crates/completion/src/render/macro_.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Renderer for macro invocations.
2+
13
use hir::{Documentation, HasSource};
24
use syntax::display::macro_label;
35
use test_utils::mark;
@@ -66,7 +68,11 @@ impl<'a> MacroRender<'a> {
6668
}
6769

6870
fn label(&self) -> String {
69-
format!("{}!{}…{}", self.name, self.bra, self.ket)
71+
if self.needs_bang() && self.ctx.snippet_cap().is_some() {
72+
format!("{}!{}…{}", self.name, self.bra, self.ket)
73+
} else {
74+
self.banged_name()
75+
}
7076
}
7177

7278
fn snippet(&self) -> String {

crates/completion/src/render/type_alias.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Renderer for type aliases.
2+
13
use hir::HasSource;
24
use syntax::{
35
ast::{NameOwner, TypeAlias},

0 commit comments

Comments
 (0)