aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/file_structure.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/file_structure.rs')
-rw-r--r--crates/ra_ide/src/file_structure.rs48
1 files changed, 24 insertions, 24 deletions
diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ra_ide/src/file_structure.rs
index 1f6a3febf..77384b6ec 100644
--- a/crates/ra_ide/src/file_structure.rs
+++ b/crates/ra_ide/src/file_structure.rs
@@ -1,5 +1,5 @@
1use ra_syntax::{ 1use ra_syntax::{
2 ast::{self, AttrsOwner, NameOwner, TypeAscriptionOwner, TypeParamsOwner}, 2 ast::{self, AttrsOwner, GenericParamsOwner, NameOwner, TypeAscriptionOwner},
3 match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, WalkEvent, 3 match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, WalkEvent,
4}; 4};
5 5
@@ -111,9 +111,9 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
111 111
112 match_ast! { 112 match_ast! {
113 match node { 113 match node {
114 ast::FnDef(it) => { 114 ast::Fn(it) => {
115 let mut detail = String::from("fn"); 115 let mut detail = String::from("fn");
116 if let Some(type_param_list) = it.type_param_list() { 116 if let Some(type_param_list) = it.generic_param_list() {
117 collapse_ws(type_param_list.syntax(), &mut detail); 117 collapse_ws(type_param_list.syntax(), &mut detail);
118 } 118 }
119 if let Some(param_list) = it.param_list() { 119 if let Some(param_list) = it.param_list() {
@@ -126,19 +126,19 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
126 126
127 decl_with_detail(it, Some(detail)) 127 decl_with_detail(it, Some(detail))
128 }, 128 },
129 ast::StructDef(it) => decl(it), 129 ast::Struct(it) => decl(it),
130 ast::UnionDef(it) => decl(it), 130 ast::Union(it) => decl(it),
131 ast::EnumDef(it) => decl(it), 131 ast::Enum(it) => decl(it),
132 ast::EnumVariant(it) => decl(it), 132 ast::Variant(it) => decl(it),
133 ast::TraitDef(it) => decl(it), 133 ast::TraitDef(it) => decl(it),
134 ast::Module(it) => decl(it), 134 ast::Module(it) => decl(it),
135 ast::TypeAliasDef(it) => { 135 ast::TypeAlias(it) => {
136 let ty = it.type_ref(); 136 let ty = it.type_ref();
137 decl_with_type_ref(it, ty) 137 decl_with_type_ref(it, ty)
138 }, 138 },
139 ast::RecordFieldDef(it) => decl_with_ascription(it), 139 ast::RecordField(it) => decl_with_ascription(it),
140 ast::ConstDef(it) => decl_with_ascription(it), 140 ast::Const(it) => decl_with_ascription(it),
141 ast::StaticDef(it) => decl_with_ascription(it), 141 ast::Static(it) => decl_with_ascription(it),
142 ast::ImplDef(it) => { 142 ast::ImplDef(it) => {
143 let target_type = it.target_type()?; 143 let target_type = it.target_type()?;
144 let target_trait = it.target_trait(); 144 let target_trait = it.target_trait();
@@ -238,7 +238,7 @@ fn very_obsolete() {}
238 label: "Foo", 238 label: "Foo",
239 navigation_range: 8..11, 239 navigation_range: 8..11,
240 node_range: 1..26, 240 node_range: 1..26,
241 kind: STRUCT_DEF, 241 kind: STRUCT,
242 detail: None, 242 detail: None,
243 deprecated: false, 243 deprecated: false,
244 }, 244 },
@@ -249,7 +249,7 @@ fn very_obsolete() {}
249 label: "x", 249 label: "x",
250 navigation_range: 18..19, 250 navigation_range: 18..19,
251 node_range: 18..24, 251 node_range: 18..24,
252 kind: RECORD_FIELD_DEF, 252 kind: RECORD_FIELD,
253 detail: Some( 253 detail: Some(
254 "i32", 254 "i32",
255 ), 255 ),
@@ -271,7 +271,7 @@ fn very_obsolete() {}
271 label: "bar1", 271 label: "bar1",
272 navigation_range: 43..47, 272 navigation_range: 43..47,
273 node_range: 40..52, 273 node_range: 40..52,
274 kind: FN_DEF, 274 kind: FN,
275 detail: Some( 275 detail: Some(
276 "fn()", 276 "fn()",
277 ), 277 ),
@@ -284,7 +284,7 @@ fn very_obsolete() {}
284 label: "bar2", 284 label: "bar2",
285 navigation_range: 60..64, 285 navigation_range: 60..64,
286 node_range: 57..81, 286 node_range: 57..81,
287 kind: FN_DEF, 287 kind: FN,
288 detail: Some( 288 detail: Some(
289 "fn<T>(t: T) -> T", 289 "fn<T>(t: T) -> T",
290 ), 290 ),
@@ -297,7 +297,7 @@ fn very_obsolete() {}
297 label: "bar3", 297 label: "bar3",
298 navigation_range: 89..93, 298 navigation_range: 89..93,
299 node_range: 86..156, 299 node_range: 86..156,
300 kind: FN_DEF, 300 kind: FN,
301 detail: Some( 301 detail: Some(
302 "fn<A, B>(a: A, b: B) -> Vec< u32 >", 302 "fn<A, B>(a: A, b: B) -> Vec< u32 >",
303 ), 303 ),
@@ -308,7 +308,7 @@ fn very_obsolete() {}
308 label: "E", 308 label: "E",
309 navigation_range: 165..166, 309 navigation_range: 165..166,
310 node_range: 160..180, 310 node_range: 160..180,
311 kind: ENUM_DEF, 311 kind: ENUM,
312 detail: None, 312 detail: None,
313 deprecated: false, 313 deprecated: false,
314 }, 314 },
@@ -319,7 +319,7 @@ fn very_obsolete() {}
319 label: "X", 319 label: "X",
320 navigation_range: 169..170, 320 navigation_range: 169..170,
321 node_range: 169..170, 321 node_range: 169..170,
322 kind: ENUM_VARIANT, 322 kind: VARIANT,
323 detail: None, 323 detail: None,
324 deprecated: false, 324 deprecated: false,
325 }, 325 },
@@ -330,7 +330,7 @@ fn very_obsolete() {}
330 label: "Y", 330 label: "Y",
331 navigation_range: 172..173, 331 navigation_range: 172..173,
332 node_range: 172..178, 332 node_range: 172..178,
333 kind: ENUM_VARIANT, 333 kind: VARIANT,
334 detail: None, 334 detail: None,
335 deprecated: false, 335 deprecated: false,
336 }, 336 },
@@ -339,7 +339,7 @@ fn very_obsolete() {}
339 label: "T", 339 label: "T",
340 navigation_range: 186..187, 340 navigation_range: 186..187,
341 node_range: 181..193, 341 node_range: 181..193,
342 kind: TYPE_ALIAS_DEF, 342 kind: TYPE_ALIAS,
343 detail: Some( 343 detail: Some(
344 "()", 344 "()",
345 ), 345 ),
@@ -350,7 +350,7 @@ fn very_obsolete() {}
350 label: "S", 350 label: "S",
351 navigation_range: 201..202, 351 navigation_range: 201..202,
352 node_range: 194..213, 352 node_range: 194..213,
353 kind: STATIC_DEF, 353 kind: STATIC,
354 detail: Some( 354 detail: Some(
355 "i32", 355 "i32",
356 ), 356 ),
@@ -361,7 +361,7 @@ fn very_obsolete() {}
361 label: "C", 361 label: "C",
362 navigation_range: 220..221, 362 navigation_range: 220..221,
363 node_range: 214..232, 363 node_range: 214..232,
364 kind: CONST_DEF, 364 kind: CONST,
365 detail: Some( 365 detail: Some(
366 "i32", 366 "i32",
367 ), 367 ),
@@ -417,7 +417,7 @@ fn very_obsolete() {}
417 label: "obsolete", 417 label: "obsolete",
418 navigation_range: 428..436, 418 navigation_range: 428..436,
419 node_range: 411..441, 419 node_range: 411..441,
420 kind: FN_DEF, 420 kind: FN,
421 detail: Some( 421 detail: Some(
422 "fn()", 422 "fn()",
423 ), 423 ),
@@ -428,7 +428,7 @@ fn very_obsolete() {}
428 label: "very_obsolete", 428 label: "very_obsolete",
429 navigation_range: 481..494, 429 navigation_range: 481..494,
430 node_range: 443..499, 430 node_range: 443..499,
431 kind: FN_DEF, 431 kind: FN,
432 detail: Some( 432 detail: Some(
433 "fn()", 433 "fn()",
434 ), 434 ),