aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/runnables.rs225
1 files changed, 210 insertions, 15 deletions
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs
index 9239ca61b..f32ce0d22 100644
--- a/crates/ra_ide/src/runnables.rs
+++ b/crates/ra_ide/src/runnables.rs
@@ -228,12 +228,38 @@ mod tests {
228 @r###" 228 @r###"
229 [ 229 [
230 Runnable { 230 Runnable {
231 range: 1..21, 231 nav: NavigationTarget {
232 file_id: FileId(
233 1,
234 ),
235 full_range: 1..21,
236 name: "main",
237 kind: FN_DEF,
238 focus_range: Some(
239 12..16,
240 ),
241 container_name: None,
242 description: None,
243 docs: None,
244 },
232 kind: Bin, 245 kind: Bin,
233 cfg_exprs: [], 246 cfg_exprs: [],
234 }, 247 },
235 Runnable { 248 Runnable {
236 range: 22..46, 249 nav: NavigationTarget {
250 file_id: FileId(
251 1,
252 ),
253 full_range: 22..46,
254 name: "test_foo",
255 kind: FN_DEF,
256 focus_range: Some(
257 33..41,
258 ),
259 container_name: None,
260 description: None,
261 docs: None,
262 },
237 kind: Test { 263 kind: Test {
238 test_id: Path( 264 test_id: Path(
239 "test_foo", 265 "test_foo",
@@ -245,7 +271,20 @@ mod tests {
245 cfg_exprs: [], 271 cfg_exprs: [],
246 }, 272 },
247 Runnable { 273 Runnable {
248 range: 47..81, 274 nav: NavigationTarget {
275 file_id: FileId(
276 1,
277 ),
278 full_range: 47..81,
279 name: "test_foo",
280 kind: FN_DEF,
281 focus_range: Some(
282 68..76,
283 ),
284 container_name: None,
285 description: None,
286 docs: None,
287 },
249 kind: Test { 288 kind: Test {
250 test_id: Path( 289 test_id: Path(
251 "test_foo", 290 "test_foo",
@@ -280,12 +319,38 @@ mod tests {
280 @r###" 319 @r###"
281 [ 320 [
282 Runnable { 321 Runnable {
283 range: 1..21, 322 nav: NavigationTarget {
323 file_id: FileId(
324 1,
325 ),
326 full_range: 1..21,
327 name: "main",
328 kind: FN_DEF,
329 focus_range: Some(
330 12..16,
331 ),
332 container_name: None,
333 description: None,
334 docs: None,
335 },
284 kind: Bin, 336 kind: Bin,
285 cfg_exprs: [], 337 cfg_exprs: [],
286 }, 338 },
287 Runnable { 339 Runnable {
288 range: 22..64, 340 nav: NavigationTarget {
341 file_id: FileId(
342 1,
343 ),
344 full_range: 22..64,
345 name: "foo",
346 kind: FN_DEF,
347 focus_range: Some(
348 56..59,
349 ),
350 container_name: None,
351 description: None,
352 docs: None,
353 },
289 kind: DocTest { 354 kind: DocTest {
290 test_id: Path( 355 test_id: Path(
291 "foo", 356 "foo",
@@ -320,12 +385,38 @@ mod tests {
320 @r###" 385 @r###"
321 [ 386 [
322 Runnable { 387 Runnable {
323 range: 1..21, 388 nav: NavigationTarget {
389 file_id: FileId(
390 1,
391 ),
392 full_range: 1..21,
393 name: "main",
394 kind: FN_DEF,
395 focus_range: Some(
396 12..16,
397 ),
398 container_name: None,
399 description: None,
400 docs: None,
401 },
324 kind: Bin, 402 kind: Bin,
325 cfg_exprs: [], 403 cfg_exprs: [],
326 }, 404 },
327 Runnable { 405 Runnable {
328 range: 51..105, 406 nav: NavigationTarget {
407 file_id: FileId(
408 1,
409 ),
410 full_range: 51..105,
411 name: "foo",
412 kind: FN_DEF,
413 focus_range: Some(
414 97..100,
415 ),
416 container_name: None,
417 description: None,
418 docs: None,
419 },
329 kind: DocTest { 420 kind: DocTest {
330 test_id: Path( 421 test_id: Path(
331 "Data::foo", 422 "Data::foo",
@@ -355,14 +446,40 @@ mod tests {
355 @r###" 446 @r###"
356 [ 447 [
357 Runnable { 448 Runnable {
358 range: 1..59, 449 nav: NavigationTarget {
450 file_id: FileId(
451 1,
452 ),
453 full_range: 1..59,
454 name: "test_mod",
455 kind: MODULE,
456 focus_range: Some(
457 13..21,
458 ),
459 container_name: None,
460 description: None,
461 docs: None,
462 },
359 kind: TestMod { 463 kind: TestMod {
360 path: "test_mod", 464 path: "test_mod",
361 }, 465 },
362 cfg_exprs: [], 466 cfg_exprs: [],
363 }, 467 },
364 Runnable { 468 Runnable {
365 range: 28..57, 469 nav: NavigationTarget {
470 file_id: FileId(
471 1,
472 ),
473 full_range: 28..57,
474 name: "test_foo1",
475 kind: FN_DEF,
476 focus_range: Some(
477 43..52,
478 ),
479 container_name: None,
480 description: None,
481 docs: None,
482 },
366 kind: Test { 483 kind: Test {
367 test_id: Path( 484 test_id: Path(
368 "test_mod::test_foo1", 485 "test_mod::test_foo1",
@@ -397,14 +514,40 @@ mod tests {
397 @r###" 514 @r###"
398 [ 515 [
399 Runnable { 516 Runnable {
400 range: 23..85, 517 nav: NavigationTarget {
518 file_id: FileId(
519 1,
520 ),
521 full_range: 23..85,
522 name: "test_mod",
523 kind: MODULE,
524 focus_range: Some(
525 27..35,
526 ),
527 container_name: None,
528 description: None,
529 docs: None,
530 },
401 kind: TestMod { 531 kind: TestMod {
402 path: "foo::test_mod", 532 path: "foo::test_mod",
403 }, 533 },
404 cfg_exprs: [], 534 cfg_exprs: [],
405 }, 535 },
406 Runnable { 536 Runnable {
407 range: 46..79, 537 nav: NavigationTarget {
538 file_id: FileId(
539 1,
540 ),
541 full_range: 46..79,
542 name: "test_foo1",
543 kind: FN_DEF,
544 focus_range: Some(
545 65..74,
546 ),
547 container_name: None,
548 description: None,
549 docs: None,
550 },
408 kind: Test { 551 kind: Test {
409 test_id: Path( 552 test_id: Path(
410 "foo::test_mod::test_foo1", 553 "foo::test_mod::test_foo1",
@@ -441,14 +584,40 @@ mod tests {
441 @r###" 584 @r###"
442 [ 585 [
443 Runnable { 586 Runnable {
444 range: 41..115, 587 nav: NavigationTarget {
588 file_id: FileId(
589 1,
590 ),
591 full_range: 41..115,
592 name: "test_mod",
593 kind: MODULE,
594 focus_range: Some(
595 45..53,
596 ),
597 container_name: None,
598 description: None,
599 docs: None,
600 },
445 kind: TestMod { 601 kind: TestMod {
446 path: "foo::bar::test_mod", 602 path: "foo::bar::test_mod",
447 }, 603 },
448 cfg_exprs: [], 604 cfg_exprs: [],
449 }, 605 },
450 Runnable { 606 Runnable {
451 range: 68..105, 607 nav: NavigationTarget {
608 file_id: FileId(
609 1,
610 ),
611 full_range: 68..105,
612 name: "test_foo1",
613 kind: FN_DEF,
614 focus_range: Some(
615 91..100,
616 ),
617 container_name: None,
618 description: None,
619 docs: None,
620 },
452 kind: Test { 621 kind: Test {
453 test_id: Path( 622 test_id: Path(
454 "foo::bar::test_mod::test_foo1", 623 "foo::bar::test_mod::test_foo1",
@@ -480,7 +649,20 @@ mod tests {
480 @r###" 649 @r###"
481 [ 650 [
482 Runnable { 651 Runnable {
483 range: 1..58, 652 nav: NavigationTarget {
653 file_id: FileId(
654 1,
655 ),
656 full_range: 1..58,
657 name: "test_foo1",
658 kind: FN_DEF,
659 focus_range: Some(
660 44..53,
661 ),
662 container_name: None,
663 description: None,
664 docs: None,
665 },
484 kind: Test { 666 kind: Test {
485 test_id: Path( 667 test_id: Path(
486 "test_foo1", 668 "test_foo1",
@@ -517,7 +699,20 @@ mod tests {
517 @r###" 699 @r###"
518 [ 700 [
519 Runnable { 701 Runnable {
520 range: 1..80, 702 nav: NavigationTarget {
703 file_id: FileId(
704 1,
705 ),
706 full_range: 1..80,
707 name: "test_foo1",
708 kind: FN_DEF,
709 focus_range: Some(
710 66..75,
711 ),
712 container_name: None,
713 description: None,
714 docs: None,
715 },
521 kind: Test { 716 kind: Test {
522 test_id: Path( 717 test_id: Path(
523 "test_foo1", 718 "test_foo1",