| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
- also unset b:ts_highlight on stop()
Fixes: #21836
|
|
|
|
|
|
|
| |
fix(treesitter): check buffer is loaded when restoring options
Also restore spelloptions
Fixes #21416
|
| |
|
| |
|
|
|
|
|
| |
* add type annotations to code
* clean up and expand static documentation
* consistent use of tags for static and generated docs
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Added 'spell' option to extmarks:
Extmarks with this set will have the region spellchecked.
- Added 'noplainbuffer' option to 'spelloptions':
This is used to tell Neovim not to spellcheck the buffer. The old
behaviour was to spell check the whole buffer unless :syntax was set.
- Added spelling support to the treesitter highlighter:
@spell captures in highlights.scm are used to define regions which
should be spell checked.
- Added support for navigating spell errors for extmarks:
Works for both ephemeral and static extmarks
- Added '_on_spell_nav' callback for decoration providers:
Since ephemeral callbacks are only drawn for the visible screen,
providers must implement this callback to instruct Neovim which
regions in the buffer need can be spell checked.
The callback takes a start position and an end position.
Note: this callback is subject to change hence the _ prefix.
- Added spell captures for built-in support languages
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the support for defining links via
vim.treesitter.highlighter.hl_map (never documented, but plugins did
anyway), or the uppercase-only `@FooGroup.Bar` to `FooGroup` rule.
The fallback is now strictly `@foo.bar.lang` to `@foo.bar` to `@foo`,
and casing is irrelevant (as it already was outside of treesitter)
For compatibility, define default links to builting syntax groups
as defined by pre-existing color schemes
|
|
|
| |
Signed-off-by: Raphael <glephunter@gmail.com>
|
|
|
|
| |
* reformat Lua runtime to make lint CI pass
* reduce max line length to 100
|
| |
|
| |
|
|
|
| |
This covers some default groups listed in :h group-name.
|
|
|
|
|
|
| |
Unlike syntax conceal, change highlight of concealed char
Can be used in tree-sitter using "conceal" metadata.
|
|
|
|
|
|
|
|
|
| |
This allows falling back to `@definition` when we have no mapping
`@definition.fancy-specialization`.
This behavior is described in tree-sitter's documentation
(https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme).
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/738
|
|
|
|
|
|
|
|
|
|
|
|
| |
The official developer documentation in in :h dev-lua-doc specifies to
use "--@" for special/magic tokens. However, this format is not
consistent with EmmyLua notation (used by some Lua language servers) nor
with the C version of the magic docstring tokens which use three comment
characters.
Further, the code base is currently split between usage of "--@",
"---@", and "--- @". In an effort to remain consistent, change all Lua
magic tokens to use "---@" and update the developer documentation
accordingly.
|
|
|
|
|
| |
These numbers are guaranteed to be stable even if you do "highlight
clear" (all attributes disappear, but not the id to name mapping itself)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the behavior of the hl_cache to the old one.
- when the capture exists as a hlgroup -> use it
- when hl_map contains a mapping -> use it
- else do nothing (before: map capture to non-existing capture)
Before also captures `@foo.bar` would intend to use the hlgroup `foo.bar`
which results in a confusing error since hlgroups can't contain dots.
|
| |
|
|
|
|
|
|
|
|
|
| |
* doc & fixes: Generate treesitter docs
* fixup to treesitter-core
* docs(treesitter): fix docs for most functions
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
|
|\
| |
| | |
fix(treesitter): check highlight queries exist
|
| | |
|
|/ |
|
| |
|
|
|
|
|
| |
Base priority is 0x1000, in order to stay kinda backward compatible.
Also set tree-sitter default highlight to 100 (middle-ish value)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|