aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter
Commit message (Collapse)AuthorAge
...
* 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
|
* feat(treesitter): allow to set highlight priority for queriesStephan Seitz2021-07-22
|
* treesitter: add predicate "any-of?" (#14344)Raymond W. Ko2021-05-14
| | | | | | | | | | | | 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.
* treesitter: do not escape in match? (#14382)Stephan Seitz2021-05-11
|
* Merge pull request #14418 from DerekStride/treesitter-set-directiveThomas Vigouroux2021-05-03
|\ | | | | [RDY] tree-sitter ensure there is a nested table allocated for `#set!`
| * Ensure there is a nested table allocated for #set!derekstride2021-04-27
| | | | | | | | | | | | | | | | Fixes the following bug: ``` test/functional/helpers.lua:107: Error executing lua: vim/treesitter/query.lua:256: attempt to index a nil value ```
* | 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 #14046 from ↵Thomas Vigouroux2021-04-14
|\ | | | | | | | | nvim-treesitter/feature/language-tree-directive-config feat(treesitter): allow injections to be configured through directives
| * feat(treesitter): allow injections to be configured through directivesSteven Sojka2021-04-02
| |
* | Merge pull request #14200 from teto/treesitter-checkhealthMarco Hinz2021-04-07
|\ \ | | | | | | feat: treesitter checkhealth
| * | fix(ts): move checkhealth in runtime/vimThomas Vigouroux2021-04-06
| | |
* | | Fix #14192: Handle IO errors and close files in query.luaStephan Seitz2021-04-02
| |/ |/|
* | 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
| |
* | ts: Add per-language query overridingTJ DeVries2021-03-30
| |
* | fix(treesitter): dedupe runtime file listSteven Sojka2021-03-23
|/
* fix: treesitter languagetree crash when using telescope buffer previewer ↵Simon Hauser2021-02-23
| | | | (#13986)
* buffer updates: add on_reload callback and handle it in treesitter parserBjörn Linse2021-02-10
|
* treesitter: propagate on_detach event properlyBjörn Linse2021-02-10
|
* treesitter: small fixesSantos Gallegos2021-02-07
| | | | Mostly typos I found while reading the code.
* fix(languagetree): use tree nodes instead of regions in containsSteven Sojka2021-01-20
|
* treesitter: Fix linter warning and add helper function to remove duplicated ↵“jvgrootveld”2021-01-18
| | | | | | | 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
* treesitter: default start and end row when omitted“jvgrootveld”2021-01-15
| | | | | | | | | | | 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.
* treesitter: simplify query reading logicBjörn Linse2021-01-04
| | | | | | | | | | | | | | 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).
* feat(treesitter): add offset predicate for language injectionSteven Sojka2020-12-15
| | | | refactor(treesitter): add directives to queries
* Merge pull request #13450 from nvim-treesitter/fix-unknown-language-parserThomas Vigouroux2020-12-10
|\ | | | | fix(treesitter): don't throw an error for missing injected langs
| * fix(treesitter): don't throw an error for missing injected langsSteven Sojka2020-12-04
| |