mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Add doc-comments to the new files
This commit is contained in:
parent
af7175f332
commit
2a214e15d3
6 changed files with 17 additions and 1 deletions
|
@ -23,11 +23,13 @@ pub(crate) use crate::render::{
|
|||
macro_::MacroRender, type_alias::TypeAliasRender,
|
||||
};
|
||||
|
||||
/// Generic renderer for completion items.
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct Render<'a> {
|
||||
ctx: RenderContext<'a>,
|
||||
}
|
||||
|
||||
/// Interface for data and methods required for items rendering.
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct RenderContext<'a> {
|
||||
completion: &'a CompletionContext<'a>,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//! Renderer for `const` fields.
|
||||
|
||||
use hir::HasSource;
|
||||
use syntax::{
|
||||
ast::{Const, NameOwner},
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//! Renderer for `enum` variants.
|
||||
|
||||
use hir::{HasAttrs, HirDisplay, ModPath, StructKind};
|
||||
use itertools::Itertools;
|
||||
use test_utils::mark;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//! Renderer for function calls.
|
||||
|
||||
use hir::{HasSource, Type};
|
||||
use syntax::{ast::Fn, display::function_declaration};
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//! Renderer for macro invocations.
|
||||
|
||||
use hir::{Documentation, HasSource};
|
||||
use syntax::display::macro_label;
|
||||
use test_utils::mark;
|
||||
|
@ -66,7 +68,11 @@ impl<'a> MacroRender<'a> {
|
|||
}
|
||||
|
||||
fn label(&self) -> String {
|
||||
format!("{}!{}…{}", self.name, self.bra, self.ket)
|
||||
if self.needs_bang() && self.ctx.snippet_cap().is_some() {
|
||||
format!("{}!{}…{}", self.name, self.bra, self.ket)
|
||||
} else {
|
||||
self.banged_name()
|
||||
}
|
||||
}
|
||||
|
||||
fn snippet(&self) -> String {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//! Renderer for type aliases.
|
||||
|
||||
use hir::HasSource;
|
||||
use syntax::{
|
||||
ast::{NameOwner, TypeAlias},
|
||||
|
|
Loading…
Reference in a new issue