diff options
Diffstat (limited to 'crates/ra_ide_api/src/display')
-rw-r--r-- | crates/ra_ide_api/src/display/structure.rs | 372 |
1 files changed, 187 insertions, 185 deletions
diff --git a/crates/ra_ide_api/src/display/structure.rs b/crates/ra_ide_api/src/display/structure.rs index ddd8b7b20..a80d65ac7 100644 --- a/crates/ra_ide_api/src/display/structure.rs +++ b/crates/ra_ide_api/src/display/structure.rs | |||
@@ -209,191 +209,193 @@ fn very_obsolete() {} | |||
209 | .unwrap(); | 209 | .unwrap(); |
210 | let structure = file_structure(&file); | 210 | let structure = file_structure(&file); |
211 | assert_debug_snapshot!(structure, | 211 | assert_debug_snapshot!(structure, |
212 | @r#"[ | 212 | @r###" |
213 | StructureNode { | 213 | [ |
214 | parent: None, | 214 | StructureNode { |
215 | label: "Foo", | 215 | parent: None, |
216 | navigation_range: [8; 11), | 216 | label: "Foo", |
217 | node_range: [1; 26), | 217 | navigation_range: [8; 11), |
218 | kind: STRUCT_DEF, | 218 | node_range: [1; 26), |
219 | detail: None, | 219 | kind: STRUCT_DEF, |
220 | deprecated: false, | 220 | detail: None, |
221 | }, | 221 | deprecated: false, |
222 | StructureNode { | 222 | }, |
223 | parent: Some( | 223 | StructureNode { |
224 | 0, | 224 | parent: Some( |
225 | ), | 225 | 0, |
226 | label: "x", | 226 | ), |
227 | navigation_range: [18; 19), | 227 | label: "x", |
228 | node_range: [18; 24), | 228 | navigation_range: [18; 19), |
229 | kind: RECORD_FIELD_DEF, | 229 | node_range: [18; 24), |
230 | detail: Some( | 230 | kind: RECORD_FIELD_DEF, |
231 | "i32", | 231 | detail: Some( |
232 | ), | 232 | "i32", |
233 | deprecated: false, | 233 | ), |
234 | }, | 234 | deprecated: false, |
235 | StructureNode { | 235 | }, |
236 | parent: None, | 236 | StructureNode { |
237 | label: "m", | 237 | parent: None, |
238 | navigation_range: [32; 33), | 238 | label: "m", |
239 | node_range: [28; 158), | 239 | navigation_range: [32; 33), |
240 | kind: MODULE, | 240 | node_range: [28; 158), |
241 | detail: None, | 241 | kind: MODULE, |
242 | deprecated: false, | 242 | detail: None, |
243 | }, | 243 | deprecated: false, |
244 | StructureNode { | 244 | }, |
245 | parent: Some( | 245 | StructureNode { |
246 | 2, | 246 | parent: Some( |
247 | ), | 247 | 2, |
248 | label: "bar1", | 248 | ), |
249 | navigation_range: [43; 47), | 249 | label: "bar1", |
250 | node_range: [40; 52), | 250 | navigation_range: [43; 47), |
251 | kind: FN_DEF, | 251 | node_range: [40; 52), |
252 | detail: Some( | 252 | kind: FN_DEF, |
253 | "fn()", | 253 | detail: Some( |
254 | ), | 254 | "fn()", |
255 | deprecated: false, | 255 | ), |
256 | }, | 256 | deprecated: false, |
257 | StructureNode { | 257 | }, |
258 | parent: Some( | 258 | StructureNode { |
259 | 2, | 259 | parent: Some( |
260 | ), | 260 | 2, |
261 | label: "bar2", | 261 | ), |
262 | navigation_range: [60; 64), | 262 | label: "bar2", |
263 | node_range: [57; 81), | 263 | navigation_range: [60; 64), |
264 | kind: FN_DEF, | 264 | node_range: [57; 81), |
265 | detail: Some( | 265 | kind: FN_DEF, |
266 | "fn<T>(t: T) -> T", | 266 | detail: Some( |
267 | ), | 267 | "fn<T>(t: T) -> T", |
268 | deprecated: false, | 268 | ), |
269 | }, | 269 | deprecated: false, |
270 | StructureNode { | 270 | }, |
271 | parent: Some( | 271 | StructureNode { |
272 | 2, | 272 | parent: Some( |
273 | ), | 273 | 2, |
274 | label: "bar3", | 274 | ), |
275 | navigation_range: [89; 93), | 275 | label: "bar3", |
276 | node_range: [86; 156), | 276 | navigation_range: [89; 93), |
277 | kind: FN_DEF, | 277 | node_range: [86; 156), |
278 | detail: Some( | 278 | kind: FN_DEF, |
279 | "fn<A, B>(a: A, b: B) -> Vec< u32 >", | 279 | detail: Some( |
280 | ), | 280 | "fn<A, B>(a: A, b: B) -> Vec< u32 >", |
281 | deprecated: false, | 281 | ), |
282 | }, | 282 | deprecated: false, |
283 | StructureNode { | 283 | }, |
284 | parent: None, | 284 | StructureNode { |
285 | label: "E", | 285 | parent: None, |
286 | navigation_range: [165; 166), | 286 | label: "E", |
287 | node_range: [160; 180), | 287 | navigation_range: [165; 166), |
288 | kind: ENUM_DEF, | 288 | node_range: [160; 180), |
289 | detail: None, | 289 | kind: ENUM_DEF, |
290 | deprecated: false, | 290 | detail: None, |
291 | }, | 291 | deprecated: false, |
292 | StructureNode { | 292 | }, |
293 | parent: Some( | 293 | StructureNode { |
294 | 6, | 294 | parent: Some( |
295 | ), | 295 | 6, |
296 | label: "X", | 296 | ), |
297 | navigation_range: [169; 170), | 297 | label: "X", |
298 | node_range: [169; 170), | 298 | navigation_range: [169; 170), |
299 | kind: ENUM_VARIANT, | 299 | node_range: [169; 170), |
300 | detail: None, | 300 | kind: ENUM_VARIANT, |
301 | deprecated: false, | 301 | detail: None, |
302 | }, | 302 | deprecated: false, |
303 | StructureNode { | 303 | }, |
304 | parent: Some( | 304 | StructureNode { |
305 | 6, | 305 | parent: Some( |
306 | ), | 306 | 6, |
307 | label: "Y", | 307 | ), |
308 | navigation_range: [172; 173), | 308 | label: "Y", |
309 | node_range: [172; 178), | 309 | navigation_range: [172; 173), |
310 | kind: ENUM_VARIANT, | 310 | node_range: [172; 178), |
311 | detail: None, | 311 | kind: ENUM_VARIANT, |
312 | deprecated: false, | 312 | detail: None, |
313 | }, | 313 | deprecated: false, |
314 | StructureNode { | 314 | }, |
315 | parent: None, | 315 | StructureNode { |
316 | label: "T", | 316 | parent: None, |
317 | navigation_range: [186; 187), | 317 | label: "T", |
318 | node_range: [181; 193), | 318 | navigation_range: [186; 187), |
319 | kind: TYPE_ALIAS_DEF, | 319 | node_range: [181; 193), |
320 | detail: Some( | 320 | kind: TYPE_ALIAS_DEF, |
321 | "()", | 321 | detail: Some( |
322 | ), | 322 | "()", |
323 | deprecated: false, | 323 | ), |
324 | }, | 324 | deprecated: false, |
325 | StructureNode { | 325 | }, |
326 | parent: None, | 326 | StructureNode { |
327 | label: "S", | 327 | parent: None, |
328 | navigation_range: [201; 202), | 328 | label: "S", |
329 | node_range: [194; 213), | 329 | navigation_range: [201; 202), |
330 | kind: STATIC_DEF, | 330 | node_range: [194; 213), |
331 | detail: Some( | 331 | kind: STATIC_DEF, |
332 | "i32", | 332 | detail: Some( |
333 | ), | 333 | "i32", |
334 | deprecated: false, | 334 | ), |
335 | }, | 335 | deprecated: false, |
336 | StructureNode { | 336 | }, |
337 | parent: None, | 337 | StructureNode { |
338 | label: "C", | 338 | parent: None, |
339 | navigation_range: [220; 221), | 339 | label: "C", |
340 | node_range: [214; 232), | 340 | navigation_range: [220; 221), |
341 | kind: CONST_DEF, | 341 | node_range: [214; 232), |
342 | detail: Some( | 342 | kind: CONST_DEF, |
343 | "i32", | 343 | detail: Some( |
344 | ), | 344 | "i32", |
345 | deprecated: false, | 345 | ), |
346 | }, | 346 | deprecated: false, |
347 | StructureNode { | 347 | }, |
348 | parent: None, | 348 | StructureNode { |
349 | label: "impl E", | 349 | parent: None, |
350 | navigation_range: [239; 240), | 350 | label: "impl E", |
351 | node_range: [234; 243), | 351 | navigation_range: [239; 240), |
352 | kind: IMPL_BLOCK, | 352 | node_range: [234; 243), |
353 | detail: None, | 353 | kind: IMPL_BLOCK, |
354 | deprecated: false, | 354 | detail: None, |
355 | }, | 355 | deprecated: false, |
356 | StructureNode { | 356 | }, |
357 | parent: None, | 357 | StructureNode { |
358 | label: "impl fmt::Debug for E", | 358 | parent: None, |
359 | navigation_range: [265; 266), | 359 | label: "impl fmt::Debug for E", |
360 | node_range: [245; 269), | 360 | navigation_range: [265; 266), |
361 | kind: IMPL_BLOCK, | 361 | node_range: [245; 269), |
362 | detail: None, | 362 | kind: IMPL_BLOCK, |
363 | deprecated: false, | 363 | detail: None, |
364 | }, | 364 | deprecated: false, |
365 | StructureNode { | 365 | }, |
366 | parent: None, | 366 | StructureNode { |
367 | label: "mc", | 367 | parent: None, |
368 | navigation_range: [284; 286), | 368 | label: "mc", |
369 | node_range: [271; 303), | 369 | navigation_range: [284; 286), |
370 | kind: MACRO_CALL, | 370 | node_range: [271; 303), |
371 | detail: None, | 371 | kind: MACRO_CALL, |
372 | deprecated: false, | 372 | detail: None, |
373 | }, | 373 | deprecated: false, |
374 | StructureNode { | 374 | }, |
375 | parent: None, | 375 | StructureNode { |
376 | label: "obsolete", | 376 | parent: None, |
377 | navigation_range: [322; 330), | 377 | label: "obsolete", |
378 | node_range: [305; 335), | 378 | navigation_range: [322; 330), |
379 | kind: FN_DEF, | 379 | node_range: [305; 335), |
380 | detail: Some( | 380 | kind: FN_DEF, |
381 | "fn()", | 381 | detail: Some( |
382 | ), | 382 | "fn()", |
383 | deprecated: true, | 383 | ), |
384 | }, | 384 | deprecated: true, |
385 | StructureNode { | 385 | }, |
386 | parent: None, | 386 | StructureNode { |
387 | label: "very_obsolete", | 387 | parent: None, |
388 | navigation_range: [375; 388), | 388 | label: "very_obsolete", |
389 | node_range: [337; 393), | 389 | navigation_range: [375; 388), |
390 | kind: FN_DEF, | 390 | node_range: [337; 393), |
391 | detail: Some( | 391 | kind: FN_DEF, |
392 | "fn()", | 392 | detail: Some( |
393 | ), | 393 | "fn()", |
394 | deprecated: true, | 394 | ), |
395 | }, | 395 | deprecated: true, |
396 | ]"# | 396 | }, |
397 | ] | ||
398 | "### | ||
397 | ); | 399 | ); |
398 | } | 400 | } |
399 | } | 401 | } |