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

Function TestHover_InterFileSupport

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

Source from the content-addressed store, hash-verified

1392}
1393
1394func TestHover_InterFileSupport(t *testing.T) {
1395 testCases := []struct {
1396 name string
1397 content string
1398 otherContent string
1399 line uint32
1400 character uint32
1401 result *protocol.Hover
1402 }{
1403 {
1404 name: "hovering over an extends service as a string",
1405 content: `
1406include:
1407 - compose.other.yaml
1408services:
1409 test2:
1410 image: alpine:3.21
1411 extends: test`,
1412 otherContent: `
1413services:
1414 test:
1415 image: alpine:3.20`,
1416 line: 6,
1417 character: 15,
1418 result: &protocol.Hover{
1419 Contents: protocol.MarkupContent{
1420 Kind: protocol.MarkupKindMarkdown,
1421 Value: "```YAML\n" + `test:
1422 image: alpine:3.20` +
1423 "\n```",
1424 },
1425 Range: &protocol.Range{
1426 Start: protocol.Position{Line: 6, Character: 13},
1427 End: protocol.Position{Line: 6, Character: 17},
1428 },
1429 },
1430 },
1431 {
1432 name: "hovering over a network defined in another file",
1433 content: `
1434include:
1435 - compose.other.yaml
1436services:
1437 serviceA:
1438 image: alpine:3.21
1439 networks:
1440 networkA:
1441 aliases:
1442 - alias1`,
1443 otherContent: `
1444networks:
1445 networkA:
1446 driver: custom`,
1447 line: 7,
1448 character: 12,
1449 result: &protocol.Hover{
1450 Contents: protocol.MarkupContent{
1451 Kind: protocol.MarkupKindMarkdown,

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected