diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-04-30 11:01:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-30 11:01:54 +0200 |
commit | 668f16bac779ac52d7bd9452e6001a7a6d1e9965 (patch) | |
tree | ae8e2a079d122393436f1267e9a6a4c2fa78063d /runtime/doc | |
parent | fa20c12ba358066858d1d2cd20d21316fe4b467b (diff) | |
download | rneovim-668f16bac779ac52d7bd9452e6001a7a6d1e9965.tar.gz rneovim-668f16bac779ac52d7bd9452e6001a7a6d1e9965.tar.bz2 rneovim-668f16bac779ac52d7bd9452e6001a7a6d1e9965.zip |
feat(treesitter): upstream query omnifunc from playground (#23394)
and set by default in `ftplugin/query.lua`
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/news.txt | 6 | ||||
-rw-r--r-- | runtime/doc/treesitter.txt | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index c343525a09..f33cffa22e 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -37,14 +37,18 @@ The following new APIs or features were added. • |vim.iter()| provides a generic iterator interface for tables and Lua iterators |luaref-in|. + • Added |vim.keycode()| for translating keycodes in a string. • Added automatic linting of treesitter query files (see |ft-query-plugin|). Automatic linting can be turned off via >lua - vim.g.query_lint_on = {} + vim.g.query_lint_on = {} < • Enabled treesitter highlighting for treesitter query files by default. +• Added |vim.treesitter.query.omnifunc()| for treesitter query files (set by + default). + ============================================================================== CHANGED FEATURES *news-changed* diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 32c97ce3ad..94690f0b7f 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -853,7 +853,7 @@ lint({buf}, {opts}) *vim.treesitter.query.lint()* 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 `lua` language will be used. + query file, e.g., if the path ends in `/lua/highlights.scm` , the parser for the `lua` language will be used. Parameters: ~ • {buf} (integer) Buffer handle @@ -875,6 +875,13 @@ list_predicates() *vim.treesitter.query.list_predicates()* Return: ~ string[] List of supported predicates. +omnifunc({findstart}, {base}) *vim.treesitter.query.omnifunc()* + Omnifunc for completing node names and predicates in treesitter queries. + + Use via >lua + vim.bo.omnifunc = 'v:lua.vim.treesitter.query.omnifunc' +< + parse({lang}, {query}) *vim.treesitter.query.parse()* Parse {query} as a string. (If the query is in a file, the caller should read the contents into a string before calling). |