Skip to content

Commit

Permalink
chore: autoformat with stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro authored and github-actions[bot] committed Jun 29, 2024
1 parent bf0da8d commit be332f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/neorg/modules/core/integrations/treesitter/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,15 @@ module.public = {
---@param filetype string? file type of the file or `norg` if omitted
get_all_nodes_in_file = function(node_type, path, filetype)
path = vim.fs.normalize(path)
if not filetype then filetype = "norg" end
if not filetype then
filetype = "norg"
end

local contents = io.open(path, "r"):read("*a")
local tree = vim.treesitter.get_string_parser(contents, filetype):parse()[1]
if not (tree or tree.root) then return {} end
if not (tree or tree.root) then
return {}
end

return module.public.search_tree(tree, node_type)
end,
Expand Down

0 comments on commit be332f5

Please sign in to comment.