mirror of
https://github.com/neovim/neovim.git
synced 2026-04-21 14:55:33 +00:00
feat(treesitter): upstream query omnifunc from playground (#23394)
and set by default in `ftplugin/query.lua`
This commit is contained in:
@@ -728,7 +728,7 @@ end
|
||||
---
|
||||
--- The found diagnostics are reported using |diagnostic-api|.
|
||||
--- By default, the parser used for verification is determined by the containing folder
|
||||
--- of the query file, e.g., if the path is `**/lua/highlights.scm`, the parser for the
|
||||
--- of the query file, e.g., if the path ends in `/lua/highlights.scm`, the parser for the
|
||||
--- `lua` language will be used.
|
||||
---@param buf (integer) Buffer handle
|
||||
---@param opts (QueryLinterOpts|nil) Optional keyword arguments:
|
||||
@@ -743,4 +743,14 @@ function M.lint(buf, opts)
|
||||
end
|
||||
end
|
||||
|
||||
--- Omnifunc for completing node names and predicates in treesitter queries.
|
||||
---
|
||||
--- Use via
|
||||
--- <pre>lua
|
||||
--- vim.bo.omnifunc = 'v:lua.vim.treesitter.query.omnifunc'
|
||||
--- </pre>
|
||||
function M.omnifunc(findstart, base)
|
||||
return require('vim.treesitter._query_linter').omnifunc(findstart, base)
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user