Skip to content

Commit 8915183

Browse files
committed
Don't require module docs for Features and Assists
1 parent f593393 commit 8915183

File tree

16 files changed

+140
-45
lines changed

16 files changed

+140
-45
lines changed

crates/ra_assists/src/handlers/add_from_impl_for_enum.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use test_utils::mark;
44

55
use crate::{utils::FamousDefs, AssistContext, AssistId, Assists};
66

7-
// Assist add_from_impl_for_enum
7+
// Assist: add_from_impl_for_enum
88
//
9-
// Adds a From impl for an enum variant with one tuple field
9+
// Adds a From impl for an enum variant with one tuple field.
1010
//
1111
// ```
1212
// enum A { <|>One(u32) }

crates/ra_assists/src/tests/generated.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,25 @@ fn main() {
5858
)
5959
}
6060

61+
#[test]
62+
fn doctest_add_from_impl_for_enum() {
63+
check_doc_test(
64+
"add_from_impl_for_enum",
65+
r#####"
66+
enum A { <|>One(u32) }
67+
"#####,
68+
r#####"
69+
enum A { One(u32) }
70+
71+
impl From<u32> for A {
72+
fn from(v: u32) -> Self {
73+
A::One(v)
74+
}
75+
}
76+
"#####,
77+
)
78+
}
79+
6180
#[test]
6281
fn doctest_add_function() {
6382
check_doc_test(

crates/ra_ide/src/display/structure.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
//! FIXME: write short doc here
2-
3-
use crate::TextRange;
4-
51
use ra_syntax::{
62
ast::{self, AttrsOwner, NameOwner, TypeAscriptionOwner, TypeParamsOwner},
7-
match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, WalkEvent,
3+
match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, WalkEvent,
84
};
95

106
#[derive(Debug, Clone)]

crates/ra_ide/src/extend_selection.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//! FIXME: write short doc here
2-
31
use std::iter::successors;
42

53
use hir::Semantics;

crates/ra_ide/src/goto_definition.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//! FIXME: write short doc here
2-
31
use hir::Semantics;
42
use ra_ide_db::{
53
defs::{classify_name, classify_name_ref},

crates/ra_ide/src/goto_implementation.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//! FIXME: write short doc here
2-
31
use hir::{Crate, ImplDef, Semantics};
42
use ra_ide_db::RootDatabase;
53
use ra_syntax::{algo::find_node_at_offset, ast, AstNode};

crates/ra_ide/src/goto_type_definition.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//! FIXME: write short doc here
2-
31
use ra_ide_db::RootDatabase;
42
use ra_syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffset};
53

crates/ra_ide/src/join_lines.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//! FIXME: write short doc here
2-
31
use itertools::Itertools;
42
use ra_fmt::{compute_ws, extract_trivial_expression};
53
use ra_syntax::{
@@ -11,6 +9,15 @@ use ra_syntax::{
119
};
1210
use ra_text_edit::{TextEdit, TextEditBuilder};
1311

12+
// Feature: Join Lines
13+
//
14+
// Join selected lines into one, smartly fixing up whitespace, trailing commas, and braces.
15+
//
16+
// |===
17+
// | Editor | Action Name
18+
//
19+
// | VS Code | **Rust Analyzer: Join lines**
20+
// |===
1421
pub fn join_lines(file: &SourceFile, range: TextRange) -> TextEdit {
1522
let range = if range.is_empty() {
1623
let syntax = file.syntax();

crates/ra_ide/src/matching_brace.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
//! FIXME: write short doc here
2-
31
use ra_syntax::{ast::AstNode, SourceFile, SyntaxKind, TextSize, T};
42

3+
// Feature: Matching Brace
4+
//
5+
// If the cursor is on any brace (`<>(){}[]`) which is a part of a brace-pair,
6+
// moves cursor to the matching brace. It uses the actual parser to determine
7+
// braces, so it won't confuse generics with comparisons.
8+
//
9+
// |===
10+
// | Editor | Action Name
11+
//
12+
// | VS Code | **Rust Analyzer: Find matching brace**
13+
// |===
514
pub fn matching_brace(file: &SourceFile, offset: TextSize) -> Option<TextSize> {
615
const BRACES: &[SyntaxKind] =
716
&[T!['{'], T!['}'], T!['['], T![']'], T!['('], T![')'], T![<], T![>]];

crates/ra_ide/src/parent_module.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//! FIXME: write short doc here
2-
31
use hir::Semantics;
42
use ra_db::{CrateId, FileId, FilePosition};
53
use ra_ide_db::RootDatabase;
@@ -11,6 +9,16 @@ use test_utils::mark;
119

1210
use crate::NavigationTarget;
1311

12+
// Feature: Parent Module
13+
//
14+
// Navigates to the parent module of the current module.
15+
//
16+
// |===
17+
// | Editor | Action Name
18+
//
19+
// | VS Code | **Rust Analyzer: Locate parent module**
20+
// |===
21+
1422
/// This returns `Vec` because a module may be included from several places. We
1523
/// don't handle this case yet though, so the Vec has length at most one.
1624
pub(crate) fn parent_module(db: &RootDatabase, position: FilePosition) -> Vec<NavigationTarget> {

0 commit comments

Comments
 (0)