Skip to content

Commit

Permalink
refactor: tree-sitter queries
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Jan 8, 2025
1 parent 1fb9073 commit b490b9e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lua/codecompanion/strategies/chat/references.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function References:clear(message)
end

local parser = vim.treesitter.get_string_parser(message.content, "markdown")
local query = vim.treesitter.query.get("markdown", "chat")
local query = vim.treesitter.query.get("markdown", "reference")
local root = parser:parse()[1]:root()

local refs = nil
Expand Down
4 changes: 0 additions & 4 deletions queries/markdown/chat.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
(_) @content
)

(section
(block_quote) @refs
)

(section
(fenced_code_block
(code_fence_content) @code
Expand Down
4 changes: 4 additions & 0 deletions queries/markdown/reference.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
(atx_heading) @role
(block_quote)? @refs
)

(section
(block_quote) @refs
)

0 comments on commit b490b9e

Please sign in to comment.