mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
fix(treesitter): recognize aliased parsers in omnifunc, query linter
**Problem:** A query file for something like `html_tags` will not be
given html node completion
**Solution:** Check for parser aliases before offering completions
Co-authored-by: Lewis Russell <me@lewisr.dev>
(cherry picked from commit 05dcda8f9b
)
This commit is contained in:
parent
e13f03af85
commit
eb53aba5af
@ -40,7 +40,8 @@ end
|
||||
local function guess_query_lang(buf)
|
||||
local filename = api.nvim_buf_get_name(buf)
|
||||
if filename ~= '' then
|
||||
return vim.F.npcall(vim.fn.fnamemodify, filename, ':p:h:t')
|
||||
local resolved_filename = vim.F.npcall(vim.fn.fnamemodify, filename, ':p:h:t')
|
||||
return resolved_filename and vim.treesitter.language.get_lang(resolved_filename) or nil
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user