@@ -343,6 +343,32 @@ func TestDefinition(t *testing.T) {
343343 End : protocol.Position {Line : 0 , Character : 12 },
344344 },
345345 },
346+ {
347+ name : "goto self complex scope 1" ,
348+ filename : "testdata/goto-self-complex-scoping.jsonnet" ,
349+ position : protocol.Position {Line : 10 , Character : 15 },
350+ targetRange : protocol.Range {
351+ Start : protocol.Position {Line : 6 , Character : 2 },
352+ End : protocol.Position {Line : 8 , Character : 3 },
353+ },
354+ targetSelectionRange : protocol.Range {
355+ Start : protocol.Position {Line : 6 , Character : 2 },
356+ End : protocol.Position {Line : 6 , Character : 6 },
357+ },
358+ },
359+ {
360+ name : "goto self complex scope 2" ,
361+ filename : "testdata/goto-self-complex-scoping.jsonnet" ,
362+ position : protocol.Position {Line : 11 , Character : 19 },
363+ targetRange : protocol.Range {
364+ Start : protocol.Position {Line : 7 , Character : 4 },
365+ End : protocol.Position {Line : 7 , Character : 18 },
366+ },
367+ targetSelectionRange : protocol.Range {
368+ Start : protocol.Position {Line : 7 , Character : 4 },
369+ End : protocol.Position {Line : 7 , Character : 9 },
370+ },
371+ },
346372 }
347373 for _ , tc := range testCases {
348374 t .Run (tc .name , func (t * testing.T ) {
@@ -471,7 +497,7 @@ func TestDefinitionFail(t *testing.T) {
471497 params : protocol.DefinitionParams {
472498 TextDocumentPositionParams : protocol.TextDocumentPositionParams {
473499 TextDocument : protocol.TextDocumentIdentifier {
474- URI : "testdata/goto-self-out-of-scope .jsonnet" ,
500+ URI : "testdata/goto-self-complex-scoping .jsonnet" ,
475501 },
476502 Position : protocol.Position {
477503 Line : 3 ,
0 commit comments