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

Function testCodeLens

internal/bake/hcl/codeLens_test.go:28–168  ·  view source on GitHub ↗
(t *testing.T, testsFolder, uriString string)

Source from the content-addressed store, hash-verified

26}
27
28func testCodeLens(t *testing.T, testsFolder, uriString string) {
29 testCases := []struct {
30 name string
31 content string
32 codeLens []protocol.CodeLens
33 }{
34 {
35 name: "empty file",
36 content: "",
37 codeLens: []protocol.CodeLens{},
38 },
39 {
40 name: "target block with no label",
41 content: "target {}",
42 codeLens: []protocol.CodeLens{},
43 },
44 {
45 name: "target block",
46 content: "target \"first\" { target = \"abc\"\n}",
47 codeLens: []protocol.CodeLens{
48 {
49 Command: &protocol.Command{
50 Title: "Build",
51 Command: types.BakeBuildCommandId,
52 Arguments: []any{
53 map[string]string{
54 "call": "build",
55 "target": "first",
56 "cwd": testsFolder,
57 },
58 },
59 },
60 Range: protocol.Range{
61 Start: protocol.Position{Line: 0},
62 End: protocol.Position{Line: 0},
63 },
64 },
65 {
66 Command: &protocol.Command{
67 Title: "Check",
68 Command: types.BakeBuildCommandId,
69 Arguments: []any{
70 map[string]string{
71 "call": "check",
72 "target": "first",
73 "cwd": testsFolder,
74 },
75 },
76 },
77 Range: protocol.Range{
78 Start: protocol.Position{Line: 0},
79 End: protocol.Position{Line: 0},
80 },
81 },
82 {
83 Command: &protocol.Command{
84 Title: "Print",
85 Command: types.BakeBuildCommandId,

Callers 2

TestCodeLensFunction · 0.85
TestCodeLens_WSLFunction · 0.85

Calls 3

NewBakeHCLDocumentFunction · 0.92
CodeLensFunction · 0.70
URIMethod · 0.65

Tested by

no test coverage detected