@@ -419,7 +419,7 @@ func TestDefinition(t *testing.T) {
419
419
{
420
420
name : "goto with overrides: clobber string" ,
421
421
filename : "testdata/goto-overrides.jsonnet" ,
422
- position : protocol.Position {Line : 39 , Character : 30 },
422
+ position : protocol.Position {Line : 40 , Character : 30 },
423
423
results : []definitionResult {{
424
424
targetRange : protocol.Range {
425
425
Start : protocol.Position {Line : 24 , Character : 4 },
@@ -434,7 +434,7 @@ func TestDefinition(t *testing.T) {
434
434
{
435
435
name : "goto with overrides: clobber nested string" ,
436
436
filename : "testdata/goto-overrides.jsonnet" ,
437
- position : protocol.Position {Line : 40 , Character : 44 },
437
+ position : protocol.Position {Line : 41 , Character : 44 },
438
438
results : []definitionResult {{
439
439
targetRange : protocol.Range {
440
440
Start : protocol.Position {Line : 26 , Character : 6 },
@@ -449,7 +449,7 @@ func TestDefinition(t *testing.T) {
449
449
{
450
450
name : "goto with overrides: clobber map" ,
451
451
filename : "testdata/goto-overrides.jsonnet" ,
452
- position : protocol.Position {Line : 41 , Character : 28 },
452
+ position : protocol.Position {Line : 42 , Character : 28 },
453
453
results : []definitionResult {{
454
454
targetRange : protocol.Range {
455
455
Start : protocol.Position {Line : 28 , Character : 4 },
@@ -496,6 +496,17 @@ func TestDefinition(t *testing.T) {
496
496
End : protocol.Position {Line : 2 , Character : 3 },
497
497
},
498
498
},
499
+ {
500
+ targetFilename : "testdata/goto-overrides-base.jsonnet" ,
501
+ targetRange : protocol.Range {
502
+ Start : protocol.Position {Line : 19 , Character : 2 },
503
+ End : protocol.Position {Line : 19 , Character : 48 },
504
+ },
505
+ targetSelectionRange : protocol.Range {
506
+ Start : protocol.Position {Line : 19 , Character : 2 },
507
+ End : protocol.Position {Line : 19 , Character : 3 },
508
+ },
509
+ },
499
510
{
500
511
targetFilename : "testdata/goto-overrides-base.jsonnet" ,
501
512
targetRange : protocol.Range {
@@ -555,6 +566,17 @@ func TestDefinition(t *testing.T) {
555
566
End : protocol.Position {Line : 4 , Character : 11 },
556
567
},
557
568
},
569
+ {
570
+ targetFilename : "testdata/goto-overrides-imported.jsonnet" ,
571
+ targetRange : protocol.Range {
572
+ Start : protocol.Position {Line : 1 , Character : 2 },
573
+ End : protocol.Position {Line : 3 , Character : 3 },
574
+ },
575
+ targetSelectionRange : protocol.Range {
576
+ Start : protocol.Position {Line : 1 , Character : 2 },
577
+ End : protocol.Position {Line : 1 , Character : 9 },
578
+ },
579
+ },
558
580
{
559
581
targetFilename : "testdata/goto-overrides-base.jsonnet" ,
560
582
targetRange : protocol.Range {
@@ -609,6 +631,38 @@ func TestDefinition(t *testing.T) {
609
631
},
610
632
}},
611
633
},
634
+ {
635
+ name : "goto with overrides: string carried from local" ,
636
+ filename : "testdata/goto-overrides.jsonnet" ,
637
+ position : protocol.Position {Line : 37 , Character : 57 },
638
+ results : []definitionResult {{
639
+ targetFilename : "testdata/goto-overrides-base.jsonnet" ,
640
+ targetRange : protocol.Range {
641
+ Start : protocol.Position {Line : 13 , Character : 6 },
642
+ End : protocol.Position {Line : 13 , Character : 24 },
643
+ },
644
+ targetSelectionRange : protocol.Range {
645
+ Start : protocol.Position {Line : 13 , Character : 6 },
646
+ End : protocol.Position {Line : 13 , Character : 16 },
647
+ },
648
+ }},
649
+ },
650
+ {
651
+ name : "goto with overrides: string carried from import" ,
652
+ filename : "testdata/goto-overrides.jsonnet" ,
653
+ position : protocol.Position {Line : 38 , Character : 57 },
654
+ results : []definitionResult {{
655
+ targetFilename : "testdata/goto-overrides-imported.jsonnet" ,
656
+ targetRange : protocol.Range {
657
+ Start : protocol.Position {Line : 2 , Character : 4 },
658
+ End : protocol.Position {Line : 2 , Character : 23 },
659
+ },
660
+ targetSelectionRange : protocol.Range {
661
+ Start : protocol.Position {Line : 2 , Character : 4 },
662
+ End : protocol.Position {Line : 2 , Character : 15 },
663
+ },
664
+ }},
665
+ },
612
666
}
613
667
for _ , tc := range testCases {
614
668
t .Run (tc .name , func (t * testing.T ) {
@@ -625,7 +679,7 @@ func TestDefinition(t *testing.T) {
625
679
server .getVM = testGetVM
626
680
serverOpenTestFile (t , server , string (tc .filename ))
627
681
response , err := server .definitionLink (context .Background (), params , false )
628
- assert .NoError (t , err )
682
+ require .NoError (t , err )
629
683
630
684
var expected []protocol.DefinitionLink
631
685
for _ , r := range tc .results {
0 commit comments