diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-27 09:23:55 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-27 09:23:55 +0000 |
commit | 5a3d2332f8d5e382fc06210c260ff6db857ac716 (patch) | |
tree | 0e12aa5d4bcdfb609faa76e01e49854ac95ccadd /crates/ra_assists/src/assists/remove_dbg.rs | |
parent | a455635b48b9b43904488bb33454c67e513bccf7 (diff) | |
parent | da5528824a836a4f36f44f90adc9fadcc98ca75b (diff) |
Merge #2086
2086: document almost all assists r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/assists/remove_dbg.rs')
-rw-r--r-- | crates/ra_assists/src/assists/remove_dbg.rs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/crates/ra_assists/src/assists/remove_dbg.rs b/crates/ra_assists/src/assists/remove_dbg.rs index ac2c43e1a..44b8de814 100644 --- a/crates/ra_assists/src/assists/remove_dbg.rs +++ b/crates/ra_assists/src/assists/remove_dbg.rs | |||
@@ -1,12 +1,26 @@ | |||
1 | //! FIXME: write short doc here | ||
2 | |||
3 | use crate::{Assist, AssistCtx, AssistId}; | ||
4 | use hir::db::HirDatabase; | 1 | use hir::db::HirDatabase; |
5 | use ra_syntax::{ | 2 | use ra_syntax::{ |
6 | ast::{self, AstNode}, | 3 | ast::{self, AstNode}, |
7 | TextUnit, T, | 4 | TextUnit, T, |
8 | }; | 5 | }; |
9 | 6 | ||
7 | use crate::{Assist, AssistCtx, AssistId}; | ||
8 | |||
9 | // Assist: remove_dbg | ||
10 | // | ||
11 | // Removes `dbg!()` macro call. | ||
12 | // | ||
13 | // ``` | ||
14 | // fn main() { | ||
15 | // <|>dbg!(92); | ||
16 | // } | ||
17 | // ``` | ||
18 | // -> | ||
19 | // ``` | ||
20 | // fn main() { | ||
21 | // 92; | ||
22 | // } | ||
23 | // ``` | ||
10 | pub(crate) fn remove_dbg(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 24 | pub(crate) fn remove_dbg(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { |
11 | let macro_call = ctx.find_node_at_offset::<ast::MacroCall>()?; | 25 | let macro_call = ctx.find_node_at_offset::<ast::MacroCall>()?; |
12 | 26 | ||