Skip to content

Commit

Permalink
iterating on the underlying problem...
Browse files Browse the repository at this point in the history
  • Loading branch information
Duologic committed Jul 1, 2024
1 parent 1d117f1 commit dd41756
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/ast/processing/find_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func FindRangesFromIndexList(stack *nodestack.NodeStack, indexList []string, vm
if funcBody := findChildDesugaredObject(bodyNode.Body); funcBody != nil {
foundDesugaredObjects = append(foundDesugaredObjects, funcBody)
}
case *ast.Binary:
tmpStack := nodestack.NewNodeStack(bodyNode)
foundDesugaredObjects = FindTopLevelObjects(tmpStack, vm)
case *ast.Var:
varReference, err := FindVarReference(bodyNode, vm)
if err != nil {
Expand Down
9 changes: 9 additions & 0 deletions pkg/server/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,15 @@ func TestCompletion(t *testing.T) {
Description: "object",
},
},
{
Label: "step",
Kind: protocol.FieldCompletion,
Detail: "newjob.step",
InsertText: "step",
LabelDetails: protocol.CompletionItemLabelDetails{
Description: "object",
},
},
},
},
},
Expand Down
5 changes: 4 additions & 1 deletion pkg/server/testdata/local_reassign.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ local job = {
steps: { name: 'a', value: 'b' },
};

local newjob = job;
local newjob = job + {
steps: {},
step: super.steps,
};

{
a: newjob,
Expand Down

0 comments on commit dd41756

Please sign in to comment.