Skip to content

Commit 74c5712

Browse files
authored
Merge pull request #109 from mrjosh/fix/completion-without-spaces-around-brackets
fix(completion): {{.Something.}} gets correct completions
2 parents fc136a4 + 9246cf0 commit 74c5712

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

internal/handler/completion_main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ func TestCompletionMainSingleLines(t *testing.T) {
164164
notExpectedInsertTexts []string
165165
err error
166166
}{
167+
{"Test completion on {{.Bad.^}}", []string{}, []string{}, errors.New("[Bad ] is no valid template context for helm")},
167168
{"Test completion on {{ .Bad.^ }}", []string{}, []string{}, errors.New("[Bad ] is no valid template context for helm")},
168169
{"Test completion on {{ n^ }}", []string{"not"}, []string{}, nil},
169170
{"Test completion on {{ .Values.^ }}", []string{"replicaCount"}, []string{}, nil},

internal/lsp/ast.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func NestedNodeAtPositionForCompletion(tree *sitter.Tree, position lsp.Position)
2424
currentNode := NodeAtPosition(tree, position)
2525
pointToLoopUp := sitter.Point{
2626
Row: position.Line,
27-
Column: position.Character,
27+
Column: position.Character - 1,
2828
}
2929
return FindRelevantChildNodeCompletion(currentNode, pointToLoopUp)
3030
}

0 commit comments

Comments
 (0)