feat(treesitter): improved logging (#23638)

- Add bindings to Treesitter ts_parser_set_logger and ts_parser_logger
- Add logfile with path STDPATH('log')/treesitter.c
- Rework existing LanguageTree loggin to use logfile
- Begin implementing log levels for vim.g.__ts_debug
This commit is contained in:
Lewis Russell
2023-05-17 11:42:18 +01:00
committed by GitHub
parent 6b19170d44
commit 189fb62032
4 changed files with 156 additions and 10 deletions

View File

@@ -73,10 +73,14 @@ function M.basename(file)
end
---@private
local function join_paths(...)
---@param ... string
---@return string
function M._join_paths(...)
return (table.concat({ ... }, '/'):gsub('//+', '/'))
end
local join_paths = M._join_paths
---@alias Iterator fun(): string?, string?
--- Return an iterator over the files and directories located in {path}