Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
qvalentin committed Nov 24, 2024
1 parent 379b150 commit 0ef253a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
4 changes: 1 addition & 3 deletions internal/lsp/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ func NestedNodeAtPositionForCompletion(tree *sitter.Tree, position lsp.Position)
Column: position.Character - 1,
}
currentNode := tree.RootNode().NamedDescendantForPointRange(pointToLookUp, pointToLookUp)
node := FindRelevantChildNodeCompletion(currentNode, pointToLookUp)

return node
return FindRelevantChildNodeCompletion(currentNode, pointToLookUp)
}

func FindRelevantChildNode(currentNode *sitter.Node, pointToLookUp sitter.Point) *sitter.Node {
Expand Down
12 changes: 0 additions & 12 deletions internal/lsp/ast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ func TestFindRelevantChildNodeCompletion(t *testing.T) {
position, content := getPositionForMarkedTestLine(tt.template)

ast := ParseAst(nil, content)

t.Logf("RootNode: %s", ast.RootNode().String())

node := NestedNodeAtPositionForCompletion(ast, position)

assert.Equal(t, tt.nodeContent, node.Content([]byte(content)))
Expand All @@ -82,16 +80,6 @@ func TestFindRelevantChildNodeCompletion(t *testing.T) {
}
}

// Takes a string with a mark (^) in it and returns the position and the string without the mark
func getPointForMarkedTestLine(buf string) (sitter.Point, string) {
col := strings.Index(buf, "^")
buf = strings.Replace(buf, "^", "", 1)
pos := sitter.Point{
Column: uint32(col),
}
return pos, buf
}

func getPositionForMarkedTestLine(buf string) (protocol.Position, string) {
col := strings.Index(buf, "^")
buf = strings.Replace(buf, "^", "", 1)
Expand Down
3 changes: 0 additions & 3 deletions internal/lsp/symbol_table_template_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ func (v *TemplateContextVisitor) ExitContextShift(node *sitter.Node) {
}
}

func (v *TemplateContextVisitor) addTemplateContextForDotInSelectorExpression() {
}

func getContextForSelectorExpression(node *sitter.Node, content []byte) TemplateContext {
if node == nil {
return TemplateContext{}
Expand Down

0 comments on commit 0ef253a

Please sign in to comment.