MCPcopy Create free account
hub / github.com/docker/docker-language-server / TestHover_ReferenceHovers

Function TestHover_ReferenceHovers

internal/compose/hover_test.go:439–1241  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

437}
438
439func TestHover_ReferenceHovers(t *testing.T) {
440 testCases := []struct {
441 name string
442 content string
443 line uint32
444 character uint32
445 result *protocol.Hover
446 }{
447 {
448 name: "hovering over an extends service as a string",
449 content: `
450services:
451 test:
452 image: alpine:3.21
453 test2:
454 image: alpine:3.21
455 extends: test`,
456 line: 6,
457 character: 15,
458 result: &protocol.Hover{
459 Contents: protocol.MarkupContent{
460 Kind: protocol.MarkupKindMarkdown,
461 Value: "```YAML\n" + `test:
462 image: alpine:3.21` +
463 "\n```",
464 },
465 Range: &protocol.Range{
466 Start: protocol.Position{Line: 6, Character: 13},
467 End: protocol.Position{Line: 6, Character: 17},
468 },
469 },
470 },
471 {
472 name: "hovering over an extends service as a string with a comment",
473 content: `
474services:
475 test:
476 # comment
477 image: alpine:3.21
478 test2:
479 image: alpine:3.21
480 extends: test`,
481 line: 7,
482 character: 15,
483 result: &protocol.Hover{
484 Contents: protocol.MarkupContent{
485 Kind: protocol.MarkupKindMarkdown,
486 Value: "```YAML\n" + `test:
487 # comment
488 image: alpine:3.21` +
489 "\n```",
490 },
491 Range: &protocol.Range{
492 Start: protocol.Position{Line: 7, Character: 13},
493 End: protocol.Position{Line: 7, Character: 17},
494 },
495 },
496 },

Callers

nothing calls this directly

Calls 4

NewComposeDocumentFunction · 0.92
NewDocumentManagerFunction · 0.92
HoverFunction · 0.70
URIMethod · 0.65

Tested by

no test coverage detected