aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/treesitter.c
Commit message (Collapse)AuthorAge
...
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* Merge pull request #18398 from vigoux/perf/ts_reuse_listbfredl2022-05-03
|\ | | | | perf(treesitter): use a reuse list for query cursors
| * perf(treesitter): use a reuse list for query cursorsThomas Vigouroux2022-05-03
| |
* | fix(treesitter): bump match limit upThomas Vigouroux2022-05-03
|/ | | | | This avoids ignoring too many match results, and avoid highlighting being blank in some files.
* refactor(uncrustify): change rules to better align with the style guideDundar Goc2022-04-29
| | | | | | | | | | | | | Add space around arithmetic operators '+' and '-'. Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. Remove space between '((' or '))' of control statements. Add space between ')' and '{' of control statements. Remove space between function name and '(' on function declaration. Collapse empty blocks between '{' and '}'. Remove newline at the end of the file. Remove newline between 'enum' and '{'. Remove newline between '}' and ')' in a function invocation. Remove newline between '}' and 'while' of 'do' statement.
* feat(treesitter): set allocator when possibleThomas Vigouroux2022-01-09
| | | | | Adds a new cmake check to keep this backwards compatible with the different versions of tree-sitter.
* refactor: saner options for uncrustify #16196dundargoc2021-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: general good option changes sp_deref = remove sp_not = remove sp_inv = remove sp_inside_paren_cast = remove mod_remove_duplicate_include = true sp_after_semi = add sp_after_semi_for = force sp_sizeof_paren = remove nl_return_expr = remove nl_else_brace = remove nl_else_if = remove * refactor: mod_remove_extra_semicolon = true * refactor: nl_max = 3 * refactor: sp_bool = force * refactor: sp_compare = force * refactor: sp_inside_paren = remove * refactor: sp_paren_paren = remove * refactor: sp_inside_sparen = remove * refactor: sp_before_sparen = force * refactor: sp_sign = remove * refactor: sp_addr = remove * refactor: sp_member = remove * refactor: nl_struct_brace = remove * refactor: nl_before_if_closing_paren = remove * refactor: nl_fdef_brace = force * refactor: sp_paren_comma = force * refactor: mod_full_brace_do = add
* refactor: remove space after starDundar Göc2021-10-19
|
* fix(treesitter): run predicates more often in iter_matchesThomas Vigouroux2021-10-01
| | | | Superseedes #15126, and fixes the issue.
* refactor: reformat with uncrustify #15736dundargoc2021-09-20
| | | | * fix function parameter comments * remove space after star in function names
* refactor: format with uncrustify #15722dundargoc2021-09-19
|
* Merge pull request #15434 from Dkendal/feature-lua-treesitter-siblingThomas Vigouroux2021-08-23
|\ | | | | feat(treesitter): add next, prev sibling method
| * feat(treesitter): add next, prev sibling methodDylan Kendal2021-08-20
| | | | | | | | | | Add tsnode methods to change to the next, previous, named or unnamed nodes.
* | refactor(map): remove extra-allocating map_new/map_free functionsBjörn Linse2021-08-22
| | | | | | | | | | | | | | | | | | | | Note: the reason for removing them is not that there after this refactor is no use of them, but rather that having them available is an anti-pattern: they manange an _extra_ heap allocation which has nothing to do with the functionality of the map itself (khash manages the real buffers internally). In case there happens to be a reason to allocate the map structure itself later, this should be made explicit using xcalloc/xfree calls.
* | refactor(api): remove unneccesary indirection around handlesBjörn Linse2021-08-22
|/ | | | | These things are just maps to pointers, no need to perform a huge song and dance around it.
* chore: use codespell to spell check #15016dundargoc2021-07-07
|
* fixup(ts): put ts_query_cursor_set_match_limit behind feature guardChristian Clason2021-06-29
| | | | | | | | | | | | | | This is a fixup for #14915, which used the above-mentioned call to restore the behavior of the pre-release version of tree-sitter to that of 0.19.5. However, this function was introduced after 0.19.5, breaking distro builds that link against 0.19.5 instead of the tag specified in neovim's build script. Now the function should only be called when it is available _and_ needed. Once tree-sitter is bumped to 0.19.6 (when this is released), this guard can be removed again. Fixes #14923 (among others)
* fix(treesitter): set match limit for query cursorsChristian Clason2021-06-26
| | | | | | | | | | | | Upstream tree-sitter raised the number of pending matches for a query cursor from 32 to 64k in <https://github.com/tree-sitter/tree-sitter/commit/ 78010722a49ed6224c773c22b0d25a8c9fbde584>, which severely impacted performance for some highlighting queries. This uses the `ts_query_cursor_set_match_limit` function introduced in <https://github.com/tree-sitter/tree-sitter/commit/ cd96552448a6e0d4eb27fc54b27cb5130c4b6f76> to manually set this back to the old default of 32. Fixes #14897
* Merge pull request #14200 from teto/treesitter-checkhealthMarco Hinz2021-04-07
|\ | | | | feat: treesitter checkhealth
| * feat(ts): include parser ABI version in checkhealthThomas Vigouroux2021-04-06
| |
* | Merge pull request #14039 from theHamsta/fix-field-introspectionThomas Vigouroux2021-04-02
|\ \ | |/ |/| Fix(treesitter): Make treesitter.inspect_lang include last field name
| * Fix(treesitter): Make treesitter.inspect_lang include last field nameStephan Seitz2021-03-23
| |
* | ts: Add language version to vim.treesitter (#14255)TJ DeVries2021-03-30
|/
* chore(ts): show grammar that triggers the errorMatthieu Coudron2021-03-16
| | | | to help debugging
* fix(treesitter): allow ranges in set_included_rangesThomas Vigouroux2020-11-23
|
* treesitter: refactor some thingsThomas Vigouroux2020-11-23
|
* fix: NULL segfaults brought to you by @vigouxTJ DeVries2020-11-18
|
* treesitter: separate tree and parserThomas Vigouroux2020-11-04
| | | | While this might sound silly, it is needed for further improvements.
* Merge pull request #13192 from bfredl/nodeidBjörn Linse2020-11-01
|\ | | | | ] treesitter: add node:id()
| * treesitter: add node:id()Björn Linse2020-11-01
| |
* | treesitter: fix wrong string formattingThomas Vigouroux2020-11-01
| |
* | tree-sitter: error out when parsing failsThomas Vigouroux2020-11-01
|/ | | | | This can happen when there is ABI mismatches, and removes the assumption parsing alwasy succeeds (which is wrong).
* 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: check language ABI version on loadThomas Vigouroux2020-10-08
| | | | This is will avoid some issues at runtime.
* treesitter: add string parser (#13008)Thomas Vigouroux2020-09-30
|
* 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: add node:field() to get field childrenThomas Vigouroux2020-09-01
|
* treesitter: allow to iterate over node childrenThomas Vigouroux2020-08-31
|
* treesitter: call bufload before parsing (#12603)Thomas Vigouroux2020-07-10
|
* treesitter: use single nodes in set_rangesThomas Vigouroux2020-06-29
| | | | fixup! treesitter: fix lint
* treesitter: fix lintThomas Vigouroux2020-06-29
|
* treesitter: use nodes to mark rangesThomas Vigouroux2020-06-29
|
* treesitter: fix some clint errorsThomas Vigouroux2020-06-29
| | | | Also fixes some mismatches on the name of the function
* treesitter: test newly added set_included_rangesThomas Vigouroux2020-06-29
|
* treesitter: add set_included_ranges to the parserThomas Vigouroux2020-06-29
| | | | This is the first step towards language injection using treesitter.
* treesitter: simplify puhstree call processThomas Vigouroux2020-06-23
|
* treesitter: check for integer overflow (#12135)Thomas Vigouroux2020-04-22
| | | | | | | Sometimes treesitter calls for an invalid column within a line, checking that the column is actually valid and forcing the value avoids an integer overflow and an infinite sequence of invalid reads. Fixes #12131
* lua: add regex support, and `@match` support in treesitter queriesBjörn Linse2020-02-26
|
* treesitter: add standard &rtp/parser/ search path for parsersBjörn Linse2020-02-07
|
* tree-sitter: implement query functionality and highlighting prototype ↵Björn Linse2019-12-22
| | | | [skip.lint]