(t *testing.T)
| 1392 | } |
| 1393 | |
| 1394 | func 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: ` |
| 1406 | include: |
| 1407 | - compose.other.yaml |
| 1408 | services: |
| 1409 | test2: |
| 1410 | image: alpine:3.21 |
| 1411 | extends: test`, |
| 1412 | otherContent: ` |
| 1413 | services: |
| 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: ` |
| 1434 | include: |
| 1435 | - compose.other.yaml |
| 1436 | services: |
| 1437 | serviceA: |
| 1438 | image: alpine:3.21 |
| 1439 | networks: |
| 1440 | networkA: |
| 1441 | aliases: |
| 1442 | - alias1`, |
| 1443 | otherContent: ` |
| 1444 | networks: |
| 1445 | networkA: |
| 1446 | driver: custom`, |
| 1447 | line: 7, |
| 1448 | character: 12, |
| 1449 | result: &protocol.Hover{ |
| 1450 | Contents: protocol.MarkupContent{ |
| 1451 | Kind: protocol.MarkupKindMarkdown, |
nothing calls this directly
no test coverage detected