From d385438bcc8d302fbcb91114e19ac0cc30528822 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Oct 2019 23:38:15 +0300 Subject: generate more assists docs --- crates/ra_assists/src/assists/add_derive.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src/assists/add_derive.rs') diff --git a/crates/ra_assists/src/assists/add_derive.rs b/crates/ra_assists/src/assists/add_derive.rs index 77ecc33c9..d3ba634c4 100644 --- a/crates/ra_assists/src/assists/add_derive.rs +++ b/crates/ra_assists/src/assists/add_derive.rs @@ -1,5 +1,3 @@ -//! FIXME: write short doc here - use hir::db::HirDatabase; use ra_syntax::{ ast::{self, AstNode, AttrsOwner}, @@ -9,6 +7,22 @@ use ra_syntax::{ use crate::{Assist, AssistCtx, AssistId}; +// Assist: add_derive +// Adds a new `#[derive()]` clause to a struct or enum. +// ``` +// struct Point { +// x: u32, +// y: u32,<|> +// } +// ``` +// -> +// ``` +// #[derive()] +// struct Point { +// x: u32, +// y: u32, +// } +// ``` pub(crate) fn add_derive(mut ctx: AssistCtx) -> Option { let nominal = ctx.node_at_offset::()?; let node_start = derive_insertion_offset(&nominal)?; -- cgit v1.2.3