aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter
Commit message (Collapse)AuthorAge
...
* 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
| |
* | fix(treesitter): incorrect method name callSteven Sojka2020-12-04
|/
* Merge pull request #13357 from vigoux/luahl-priorityBjörn Linse2020-11-25
|\ | | | | feat(luahl): add priority mechanism
| * 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)
* | languagetree: call changedtree callback per treeThomas Vigouroux2020-11-24
| | | | | | | | Also fix a typo
* | fix(treesitter): allow ranges in set_included_rangesThomas Vigouroux2020-11-23
|/
* 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>
* tree-sitter: Put base languages first in queriesStephan Seitz2020-11-08
| | | | | | | | 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
* Merge pull request #13178 from steelsojka/fix-empty-main-query-fileThomas Vigouroux2020-11-02
|\ | | | | fix(treesitter): account for no main query file
| * fix(treesitter): account for no main query fileSteven Sojka2020-10-28
| |
* | 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
|
* treesitter: add string parser (#13008)Thomas Vigouroux2020-09-30
|