Skip to content

Commit

Permalink
fix(treesitter): don't constantly log errors about erroneous document…
Browse files Browse the repository at this point in the history
… syntax trees
  • Loading branch information
vhyrro committed Feb 2, 2023
1 parent b977fa0 commit 9f8b0a1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lua/neorg/modules/core/integrations/treesitter/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ module.public = {
--- Extracts the document root from the current document or from the string
---@param src number|string The number of the buffer to extract or string with code (can be nil)
---@param filetype string? #The filetype of the buffer or the string with code
---@return userdata #The root node of the document
---@return userdata? #The root node of the document
get_document_root = function(src, filetype)
filetype = filetype or "norg"

Expand All @@ -514,7 +514,6 @@ module.public = {
local tree = parser:parse()[1]

if not tree or not tree:root() or tree:root():type() == "ERROR" then
log.warn("Unable to parse the current document's syntax tree :(")
return
end

Expand Down

0 comments on commit 9f8b0a1

Please sign in to comment.