aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/highlighter.lua
Commit message (Collapse)AuthorAge
* fix(treesitter): really restore syntaxLewis Russell2023-01-17
| | | | | - also unset b:ts_highlight on stop() Fixes: #21836
* fix(ts): check buffer is loaded when restoring options (#21419)Lewis Russell2022-12-14
| | | | | | | fix(treesitter): check buffer is loaded when restoring options Also restore spelloptions Fixes #21416
* fix(treesitter): properly restore `'syntax'` (#21358)Lewis Russell2022-12-14
|
* feat(spell): support nospell in treesitter queriesLewis Russell2022-11-12
|
* docs(treesitter): clean up and update treesitter.txt (#20142)Christian Clason2022-09-14
| | | | | * add type annotations to code * clean up and expand static documentation * consistent use of tags for static and generated docs
* fix(ts): do not clobber spelloptions (#20095)Lewis Russell2022-09-06
|
* feat(extmarks,ts,spell): full support for spellingThomas Vigouroux2022-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* feat(treesitter)!: use @foo.bar style highlight groupsbfredl2022-08-26
| | | | | | | | | | | | 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
* refactor(lua): replace vim.cmd use with API calls (#19283)Raphael2022-07-09
| | | Signed-off-by: Raphael <glephunter@gmail.com>
* refactor(lua): reformat with stylua 0.14.0 (#19264)Christian Clason2022-07-07
| | | | * reformat Lua runtime to make lint CI pass * reduce max line length to 100
* fix(treesitter): new iter if foldedkevinhwang912022-06-16
|
* chore: format runtime with styluaChristian Clason2022-05-09
|
* feat(treesitter): add more default groups to highlight map (#17835)Gregory Anders2022-03-30
| | | This covers some default groups listed in :h group-name.
* feat(ui): allow conceal to be defined in decorationsbfredl2022-03-20
| | | | | | Unlike syntax conceal, change highlight of concealed char Can be used in tree-sitter using "conceal" metadata.
* feat(tree-sitter): allow Atom-style capture fallbacks (#14196)Stephan Seitz2022-02-16
| | | | | | | | | 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
* docs: make Lua docstrings consistent #15255Gregory Anders2021-08-22
| | | | | | | | | | | | 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.
* perf(treesitter): avoid string lookup of highlight name in hot loopBjörn Linse2021-08-19
| | | | | These numbers are guaranteed to be stable even if you do "highlight clear" (all attributes disappear, but not the id to name mapping itself)
* chore: remove reference to nvim-treesitter in commentStephan Seitz2021-08-06
|
* fix(treesitter): do not map hl_group when no mapping is setStephan Seitz2021-08-06
| | | | | | | | | | | 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.
* feat(treesitter): allow to set highlight priority for queriesStephan Seitz2021-07-22
|
* docs: Treesitter (#13260)TJ DeVries2021-05-01
| | | | | | | | | * doc & fixes: Generate treesitter docs * fixup to treesitter-core * docs(treesitter): fix docs for most functions Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
* Merge pull request #14218 from steelsojka/bugfix/check-queries-existThomas Vigouroux2021-04-02
|\ | | | | fix(treesitter): check highlight queries exist
| * fix(treesitter): check highlight queries existSteven Sojka2021-03-26
| |
* | ts: Add per-language highlight linksTJ DeVries2021-03-31
|/
* treesitter: propagate on_detach event properlyBjörn Linse2021-02-10
|
* feat(luahl): add priority mechanismThomas Vigouroux2020-11-25
| | | | | Base priority is 0x1000, in order to stay kinda backward compatible. Also set tree-sitter default highlight to 100 (middle-ish value)
* feat(treesitter): add language treeSteven Sojka2020-11-23
| | | | | | | | | | | | | 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>
* treesitter: add node:id()Björn Linse2020-11-01
|
* treesitter: allow multiple highlighters per bufferThomas Vigouroux2020-10-12
|
* treesitter: allow custom parser for highlighterThomas Vigouroux2020-10-12
| | | | | | | | | | | 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>
* treesitter: runtime queriesThomas Vigouroux2020-10-11
| | | | | | | | | | | | | 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>
* api: multiple decoration providers at onceBjörn Linse2020-10-10
|
* luahl: global the luahlBjörn Linse2020-09-13
|
* fix: use luahl in treesitterThomas Vigouroux2020-09-13
|
* wip trying to fix the highlighterThomas Vigouroux2020-09-09
|
* treesitter: use new on_bytes interfaceBjörn Linse2020-09-09
| | | | | | | | | | 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: revert wrong optimization in highlightsThomas Vigouroux2020-09-09
|
* apply bfredl suggestionkiyan422020-09-06
|
* treesitter: check hl group exists before passing it in nvim_get_hl_id_by_namekiyan422020-09-05
|
* treesitter: update to use buf_set_extmarkThomas Vigouroux2020-09-03
|
* treesitter(docs): update and refresh docsThomas Vigouroux2020-08-13
|
* treesitter: refactor and use lua regexesThomas Vigouroux2020-08-13