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

Function TestCompletion_WSL

internal/bake/hcl/completion_test.go:587–690  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

585}
586
587func TestCompletion_WSL(t *testing.T) {
588 testCases := []struct {
589 name string
590 content string
591 dockerfileContent string
592 line uint32
593 character uint32
594 items []protocol.CompletionItem
595 }{
596 {
597 name: "target attribute in target block",
598 content: "target \"api\" {\n target = \"\"\n}",
599 line: 1,
600 dockerfileContent: "",
601 character: 12,
602 items: []protocol.CompletionItem{
603 {
604 Label: "base",
605 },
606 {
607 Label: "tests",
608 },
609 {
610 Label: "release",
611 },
612 },
613 },
614 {
615 name: "args keys in target block",
616 content: "target \"api\" {\n args = {\n \"blah\" = \"\"\n }\n}",
617 line: 2,
618 dockerfileContent: "",
619 character: 5,
620 items: []protocol.CompletionItem{
621 {
622 Label: "TARGETOS",
623 },
624 {
625 Label: "TARGETARCH",
626 },
627 {
628 Label: "argOne",
629 },
630 {
631 Label: "argTwo",
632 },
633 {
634 Label: "argOnePredefined",
635 },
636 },
637 },
638 {
639 name: "resolve build stage targets from a Dockerfile inside a context folder",
640 content: "target \"backend\" {\n context = \"./backend\"\n target=\"\"\n}",
641 line: 2,
642 character: 10,
643 items: []protocol.CompletionItem{
644 {

Callers

nothing calls this directly

Calls 5

NewDocumentManagerFunction · 0.92
NewBakeHCLDocumentFunction · 0.92
CompletionFunction · 0.70
URIMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected