(t *testing.T)
| 437 | } |
| 438 | |
| 439 | func 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: ` |
| 450 | services: |
| 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: ` |
| 474 | services: |
| 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 | }, |
nothing calls this directly
no test coverage detected