aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter
Commit message (Collapse)AuthorAge
* 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(treesitter): add 'lang' option to show_tree() (#21341)Gregory Anders2022-12-08
| | | | This is necessary for now to support filetypes that use a parser with a different name (e.g. the "terraform" filetype uses the "hcl" parser).
* feat(treesitter): add vim.treesitter.show_tree() (#21322)Gregory Anders2022-12-08
| | | | | | | Add a "show_tree" function to view a textual representation of the nodes in a language tree in a window. Moving the cursor in the window highlights the corresponding text in the source buffer, and moving the cursor in the source buffer highlights the corresponding nodes in the window.
* docs(gen): support language annotation in docstringsChristian Clason2022-12-02
|
* feat(spell): support nospell in treesitter queriesLewis Russell2022-11-12
|
* feat(checkhealth): check runtime ($VIMRUNTIME)Justin M. Keyes2022-10-30
| | | | | | Move man/health.lua into the "runtime" check. fix #20696
* feat(checkhealth): improve treesitter reportJustin M. Keyes2022-10-30
|
* fix(query): fix unnatural order for inherits in treesitter queries (#20298)Sergey Berezhnoy2022-09-29
| | | close #20297
* fix(docs): invalid :help links #20345Justin M. Keyes2022-09-25
| | | | | Fix those naughty single quotes. closes #20159
* 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(treesitter): prevent endless loop on self-inheritenceThomas Vigouroux2022-09-11
| | | | Fixes #20139
* fix(treesitter): use the right loading order for base queries (#20117)bfredl2022-09-08
| | | | | Use the first, not last, query for a language on runtimepath. Typically, this implies that a user query will override a site plugin query, which will override a bundled runtime query.
* feat(treesitter)!: do not merge queries by default (#20105)Thomas Vigouroux2022-09-08
| | | | | | | | | | Problem: Treesitter queries for a given language in runtime were merged together, leading to errors if they targeted different parser versions (e.g., bundled viml queries and those shipped by nvim-treesitter). Solution: Runtime queries now work as follows: * The last query in the rtp without `; extends` in the header will be used as the base query * All queries (without a specific order) with `; extends` are concatenated with the base query BREAKING CHANGE: queries need to be updated if they are meant to extend other queries
* Use weak tables in tree-sitter code (#17117)Thomas Vigouroux2022-09-07
| | | | | | feat(treesitter): use weak tables when possible Also add the defaulttable function to create a table whose values are created when a key is missing.
* 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
* feat(treesitter): clarify similar 'get_node_range' functionsQuentin Rasmont2022-08-25
| | | | | | | | | The private 'get_node_range' function from the languagetree module has been renamed and remains private as it serve a purpose that is only relevant inside the languagetree module. The 'get_node_range' upstreamed from nvim-treesitter in the treesitter module has been made public as it is in itself a utlity function.
* feat(treesitter): add ability to retreive a tree/node given a rangeQuentin Rasmont2022-08-25
|
* feat(treesitter): add opts.concat to query.get_text_nodeQuentin Rasmont2022-08-25
| | | | | | | As part of the upstream of utility functions from nvim-treesitter, this option when set to false allows to return a table (downstream behavior). Effectively making the switch from the downstream to the upstream function much easier.
* feat(treesitter): allow customizing language symbol nameThomas Vigouroux2022-08-22
|
* fix(treesitter): don't error when node argument of predicate is nil (#19355)Stephan Seitz2022-07-14
| | | | | | When the node mentioned in a predicate is not required for the query then predicates putting restrictions on that node shouldn't run. Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/2600
* 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
|
* fix(treesitter): correct region for string parser (#18794)Christian Clason2022-06-02
| | | fixes injections for string parsers after https://github.com/neovim/neovim/commit/eab4d03a3264b2afaf803ed839fa25bc4e7acedd
* fix(treesitter): offset directive associates range with capture (#18276)Lewis Russell2022-05-28
| | | | | | | | | Previously the `offset!` directive populated the metadata in such a way that the new range could be attributed to a specific capture. #14046 made it so the directive simply stored just the new range in the metadata and information about what capture the range is based from is lost. This change reverts that whilst also correcting the docs.
* Merge pull request #18502 from drybalka/fix-languagetree-contains-descriptionChristian Clason2022-05-19
|\ | | | | treesitter: small improvements of languagetree.lua
| * refactor: simple logic in tree_contains()Denys2022-05-18
| |
| * docs: correct description of LanguageTree:contains()Denys2022-05-18
| |
* | 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: treesitter.txt - fix overflowing lines, document ↵Chinmay Dalal2022-02-13
| | | | minimum_language_version (#17286)
* fix(query.lua): check empty table for lineskevinhwang912022-02-11
| | | | The range of node may make `nvim_buf_get_lines` return an empty table.
* fix(ts): escape lang when loading parsers (#16668)Lewis Russell2022-01-27
| | | | | | | | | | | When trying to load a language parser, escape the value of the language. With language injection, the language might be picked up from the buffer. If this value is erroneous it can cause `nvim_get_runtime_file` to hard error. E.g., the markdown expression `~~~{` will extract '{' as a language and then try to get the parser using `parser/{*` as the pattern.
* perf(treesitter): cache query parsingStephan Seitz2022-01-06
|
* chore: fix typos (#16816)dundargoc2022-01-04
| | | | | | | Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Sebastian Volland <seb@baunz.net> Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* feat(treesitter): multiline match predicatesLewis Russell2021-12-12
|
* feat(ts): add support for multiline nodes in get_node_text (#14999)Mathias Fußenegger2021-12-12
| | | | | | Based on https://github.com/neovim/neovim/pull/14445 This extends `vim.treesitter.query.get_node_text` to return the text that spans a node's range even if start_row ~= end_row.
* chore: fix typos (#16361)dundargoc2021-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: István Donkó <istvan.donko@gmail.com> Co-authored-by: Julian Berman <Julian@GrayVines.com> Co-authored-by: bryant <bryant@users.noreply.github.com> Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com> Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com> Co-authored-by: Jesse Wertheim <jaawerth@gmail.com> Co-authored-by: dm1try <me@dmitry.it> Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl> Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com> Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: István Donkó <istvan.donko@gmail.com> Co-authored-by: Julian Berman <Julian@GrayVines.com> Co-authored-by: bryant <bryant@users.noreply.github.com> Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com> Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com> Co-authored-by: Jesse Wertheim <jaawerth@gmail.com> Co-authored-by: dm1try <me@dmitry.it> Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl> Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
* fix(healthcheck): update builtins to the new convention #15914Javier Lopez2021-10-05
| | | Adjust some builtin healthchecks to use Lua, after #15259
* 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.
* docs(ts): add documentation for listing fnsThomas Vigouroux2021-07-25
|
* treesitter: add query.list_directivesStephan Seitz2021-07-24
|