mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 20:43:21 +00:00
add blank lines for readability
This commit is contained in:
parent
e3a253d80f
commit
394e474479
6 changed files with 11 additions and 1 deletions
|
@ -8,7 +8,9 @@ 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,
|
||||
|
|
|
@ -7,7 +7,9 @@ use ra_syntax::{
|
|||
use crate::{Assist, AssistCtx, AssistId};
|
||||
|
||||
// Assist: add_explicit_type
|
||||
//
|
||||
// Specify type for a let binding
|
||||
//
|
||||
// ```
|
||||
// fn main() {
|
||||
// let x<|> = 92;
|
||||
|
|
|
@ -9,7 +9,9 @@ use ra_syntax::{
|
|||
use crate::{Assist, AssistCtx, AssistId};
|
||||
|
||||
// Assist: add_impl
|
||||
//
|
||||
// Adds a new inherent impl for a type
|
||||
//
|
||||
// ```
|
||||
// struct Ctx<T: Clone> {
|
||||
// data: T,<|>
|
||||
|
|
|
@ -13,7 +13,9 @@ enum AddMissingImplMembersMode {
|
|||
}
|
||||
|
||||
// Assist: add_impl_missing_members
|
||||
//
|
||||
// Adds scaffold for required impl members
|
||||
//
|
||||
// ```
|
||||
// trait T {
|
||||
// Type X;
|
||||
|
|
|
@ -5,11 +5,13 @@ use ra_syntax::SyntaxNode;
|
|||
use crate::{Assist, AssistCtx, AssistId};
|
||||
|
||||
// Assist: apply_demorgan
|
||||
//
|
||||
// Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws).
|
||||
// This transforms expressions of the form `!l || !r` into `!(l && r)`.
|
||||
// This also works with `&&`. This assist can only be applied with the cursor
|
||||
// on either `||` or `&&`, with both operands being a negation of some kind.
|
||||
// This means something of the form `!x` or `x != y`.
|
||||
//
|
||||
// ```
|
||||
// fn main() {
|
||||
// if x != 4 ||<|> !y {}
|
||||
|
|
|
@ -51,7 +51,7 @@ fn collect_assists() -> Result<Vec<Assist>> {
|
|||
id
|
||||
);
|
||||
|
||||
let doc = take_until(lines.by_ref(), "```");
|
||||
let doc = take_until(lines.by_ref(), "```").trim().to_string();
|
||||
let before = take_until(lines.by_ref(), "```");
|
||||
|
||||
assert_eq!(lines.next().unwrap().as_str(), "->");
|
||||
|
|
Loading…
Reference in a new issue