| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
| |
For the case of Clojure and other Lisp syntax highlighting, it is
necessary to create huge regexps consisting of hundreds of symbols with
the pipe (|) character. To make things more difficult, these Lisp
symbols sometimes consists of special characters that are themselves
part of special regexp characters like '*'. In addition to being
difficult to maintain, it's performance is suboptimal.
This patch introduces a new predicate to perform 'source' matching in
amortized constant time. This is accomplished by compiling a hash table
on the first use.
|
| |
|
|\
| |
| | |
[RDY] tree-sitter ensure there is a nested table allocated for `#set!`
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes the following bug:
```
test/functional/helpers.lua:107: Error executing lua:
vim/treesitter/query.lua:256: attempt to index a nil value
```
|
|/
|
|
|
|
|
|
|
| |
* doc & fixes: Generate treesitter docs
* fixup to treesitter-core
* docs(treesitter): fix docs for most functions
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
|
|\
| |
| |
| |
| | |
nvim-treesitter/feature/language-tree-directive-config
feat(treesitter): allow injections to be configured through directives
|
| | |
|
|\ \
| | |
| | | |
feat: treesitter checkhealth
|
| | | |
|
| |/
|/| |
|
|\ \
| |/
|/| |
fix(treesitter): check highlight queries exist
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
(#13986)
|
| |
|
| |
|
|
|
|
| |
Mostly typos I found while reading the code.
|
| |
|
|
|
|
|
|
|
| |
logic
This function returns the start and stop value if set else the node's range is used
When the node's range is used, the stop is incremented by 1 to make the search inclusive
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for default start and end row when omitted in the
query:iter_captures and query:iter_matches functions.
When the start and end row values are omitted, the values of the given
node is used. The end row value is incremented by 1 to include the node end
row in the match.
Updated tests and docs accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only the plugin/package manager should "manage" after/. Consumers of
nvim_get_runtime_file() should not need to special case it (if your plugin
manager is broken then fix it instead).
Don't use vim.fn.readfile(). Lua can already read files. It is even
better at it than vim script.
expose M.get_query_files(). Listing the queries is essential for user
config debug, and let plugins do fun things with it.
Abstraction-by-obscurity is not useful (plugins can just cargo cult copy
the code anyway, better with public entry points).
|
|
|
|
| |
refactor(treesitter): add directives to queries
|
|\
| |
| | |
fix(treesitter): don't throw an error for missing injected langs
|
| | |
|
|/ |
|
|\
| |
| | |
feat(luahl): add priority mechanism
|
| |
| |
| |
| |
| | |
Base priority is 0x1000, in order to stay kinda backward compatible.
Also set tree-sitter default highlight to 100 (middle-ish value)
|
| |
| |
| |
| | |
Also fix a typo
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement the LanguageTree structure to enable language injection.
This is done be removing the old Parser metatable and replacing by the
new structure, with the same API (almost).
Some noticeable differences :
- `parser:parse()` now returns a table of trees
- There is no incremental parsing for child (injected) languages
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
|
|
|
|
|
|
|
|
| |
This reverts the handling of base languages to the old way how
nvim-treesitter handled them. When a language extends a base language
it usually wants to be able to overwrite queries.
Related: https://github.com/nvim-treesitter/nvim-treesitter/issues/633
|
|\
| |
| | |
fix(treesitter): account for no main query file
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Also allow to get parser ranges.
This will be useful for language injection, allowing us to tweak the
parser's ranges on the fly.
Update runtime/lua/vim/treesitter.lua
Co-authored-by: Paul Burlumi <paul@burlumi.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Runtime queries just work like ftplugins, that is:
- Queries in the `after` directory are sourced _after_ the "base" query
- Otherwise, the last define query takes precedence.
Queries can be found in the `queries` directory.
Update runtime/lua/vim/treesitter/query.lua
Co-authored-by: Paul Burlumi <paul@burlumi.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This will significantly reduce the parsing work
needed e.g. when rehighlighting after every keypress
in insert mode.
Also add safety check for tree-sitter trying to read
past the end of a line. This can happen after we sent
an incorrect buffer update.
|
| |
|
|\
| |
| | |
treesitter: check hl group exists before passing it in nvim_get_hl_id_by_name
|
| | |
|
| | |
|
| | |
|