mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-18 01:39:00 +00:00
fix(scripts): format-queries defaults to cwd
This commit is contained in:
committed by
Phạm Huy Hoàng
parent
e04ce8bcec
commit
4b27f87fef
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -46,5 +46,5 @@ jobs:
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
nvim -l scripts/format-queries.lua queries
|
||||
nvim -l scripts/format-queries.lua
|
||||
git diff --exit-code
|
||||
|
||||
@@ -6,13 +6,11 @@ local get_node_text = ts.get_node_text
|
||||
---@type string[]
|
||||
local files
|
||||
|
||||
if not _G.arg[1] then
|
||||
print "Must specify file or directory to format!"
|
||||
return
|
||||
elseif _G.arg[1]:match ".*%.scm$" then
|
||||
files = { _G.arg[1] }
|
||||
local arg = _G.arg[1] or "."
|
||||
if arg:match ".*%.scm$" then
|
||||
files = { arg }
|
||||
else
|
||||
files = vim.fn.split(vim.fn.glob(_G.arg[1] .. "/**/*.scm"))
|
||||
files = vim.fn.split(vim.fn.glob(arg .. "/**/*.scm"))
|
||||
end
|
||||
|
||||
ts.query.add_predicate("has-type?", function(match, _, _, pred)
|
||||
|
||||
Reference in New Issue
Block a user