diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-07 18:48:35 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-07 18:48:35 +0000 |
commit | 03b886de53834168dd52b5e504a649292f129ae6 (patch) | |
tree | 8aa5589eef906e67a55ae2737ca1a6f731793f39 /crates/ide/src/folding_ranges.rs | |
parent | 8a950dfb406a927085602af016855cfe1988aee1 (diff) | |
parent | a1c8bdecfd408b7573357604f9c6543556f3f19a (diff) |
Merge #6719
6719: Use items can also have doc comments r=matklad a=Veykril
Prior to this change modules show more docs than they have cause they inherit the docs from documented use items inside of them.
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide/src/folding_ranges.rs')
-rw-r--r-- | crates/ide/src/folding_ranges.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ide/src/folding_ranges.rs b/crates/ide/src/folding_ranges.rs index 7523aec55..45170dd29 100644 --- a/crates/ide/src/folding_ranges.rs +++ b/crates/ide/src/folding_ranges.rs | |||
@@ -83,7 +83,6 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> { | |||
83 | fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> { | 83 | fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> { |
84 | match kind { | 84 | match kind { |
85 | COMMENT => Some(FoldKind::Comment), | 85 | COMMENT => Some(FoldKind::Comment), |
86 | USE => Some(FoldKind::Imports), | ||
87 | ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), | 86 | ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), |
88 | ASSOC_ITEM_LIST | 87 | ASSOC_ITEM_LIST |
89 | | RECORD_FIELD_LIST | 88 | | RECORD_FIELD_LIST |
@@ -258,11 +257,11 @@ fn main() <fold block>{ | |||
258 | fn test_fold_imports() { | 257 | fn test_fold_imports() { |
259 | check( | 258 | check( |
260 | r#" | 259 | r#" |
261 | <fold imports>use std::<fold block>{ | 260 | use std::<fold block>{ |
262 | str, | 261 | str, |
263 | vec, | 262 | vec, |
264 | io as iop | 263 | io as iop |
265 | }</fold>;</fold> | 264 | }</fold>; |
266 | 265 | ||
267 | fn main() <fold block>{ | 266 | fn main() <fold block>{ |
268 | }</fold>"#, | 267 | }</fold>"#, |
@@ -306,9 +305,9 @@ use std::io as iop;</fold> | |||
306 | <fold imports>use std::mem; | 305 | <fold imports>use std::mem; |
307 | use std::f64;</fold> | 306 | use std::f64;</fold> |
308 | 307 | ||
309 | use std::collections::HashMap; | 308 | <fold imports>use std::collections::HashMap; |
310 | // Some random comment | 309 | // Some random comment |
311 | use std::collections::VecDeque; | 310 | use std::collections::VecDeque;</fold> |
312 | 311 | ||
313 | fn main() <fold block>{ | 312 | fn main() <fold block>{ |
314 | }</fold>"#, | 313 | }</fold>"#, |
@@ -326,10 +325,10 @@ use std::io as iop;</fold> | |||
326 | <fold imports>use std::mem; | 325 | <fold imports>use std::mem; |
327 | use std::f64;</fold> | 326 | use std::f64;</fold> |
328 | 327 | ||
329 | <fold imports>use std::collections::<fold block>{ | 328 | use std::collections::<fold block>{ |
330 | HashMap, | 329 | HashMap, |
331 | VecDeque, | 330 | VecDeque, |
332 | }</fold>;</fold> | 331 | }</fold>; |
333 | // Some random comment | 332 | // Some random comment |
334 | 333 | ||
335 | fn main() <fold block>{ | 334 | fn main() <fold block>{ |