Skip to content

Commit

Permalink
Merge pull request #109 from mrjosh/fix/completion-without-spaces-aro…
Browse files Browse the repository at this point in the history
…und-brackets

fix(completion): {{.Something.}} gets correct completions
  • Loading branch information
qvalentin authored Aug 28, 2024
2 parents fc136a4 + 9246cf0 commit 74c5712
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/handler/completion_main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func TestCompletionMainSingleLines(t *testing.T) {
notExpectedInsertTexts []string
err error
}{
{"Test completion on {{.Bad.^}}", []string{}, []string{}, errors.New("[Bad ] is no valid template context for helm")},
{"Test completion on {{ .Bad.^ }}", []string{}, []string{}, errors.New("[Bad ] is no valid template context for helm")},
{"Test completion on {{ n^ }}", []string{"not"}, []string{}, nil},
{"Test completion on {{ .Values.^ }}", []string{"replicaCount"}, []string{}, nil},
Expand Down
2 changes: 1 addition & 1 deletion internal/lsp/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NestedNodeAtPositionForCompletion(tree *sitter.Tree, position lsp.Position)
currentNode := NodeAtPosition(tree, position)
pointToLoopUp := sitter.Point{
Row: position.Line,
Column: position.Character,
Column: position.Character - 1,
}
return FindRelevantChildNodeCompletion(currentNode, pointToLoopUp)
}
Expand Down

0 comments on commit 74c5712

Please # to comment.