aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter
Commit message (Collapse)AuthorAge
...
* fix(treesitter): redraw added/removed injections properly (#23287)Lewis Russell2023-04-30
| | | | | | When injections are added or removed make sure to: - invoke 'changedtree' callbacks for when new trees are added. - invoke 'changedtree' callbacks for when trees are invalidated - redraw regions when languagetree children are removed
* feat(treesitter): upstream query omnifunc from playground (#23394)Christian Clason2023-04-30
| | | and set by default in `ftplugin/query.lua`
* feat(treesitter): add query_linter from nvim-treesitter/playground (#22784)Stephan Seitz2023-04-29
| | | | Co-authored-by: clason <clason@users.noreply.github.com> Co-authored-by: lewis6991 <lewis6991@users.noreply.github.com>
* fix(treesitter playground): fix the wrong range of a node displayed i… ↵William2023-04-20
| | | | | | | (#23209) fix(treesitter playground): wrong range of a node displayed in playground The call parameters order of the function `get_range_str` is flipped for the last two arguments compared to the declaration.
* refactor: deprecate checkhealth functionsdundargoc2023-04-15
| | | | | | | | | | | | | | | | | | | | | | | The following functions are deprecated and will be removed in Nvim v0.11: - health#report_start() - health#report_info() - health#report_ok() - health#report_warn() - health#report_error() - vim.health.report_start() - vim.health.report_info() - vim.health.report_ok() - vim.health.report_warn() - vim.health.report_error() Users should instead use these: - vim.health.start() - vim.health.info() - vim.health.ok() - vim.health.warn() - vim.health.error()
* fix(treesitter): Use the correct replacement args for #gsub! directive (#23015)Scott Ming2023-04-11
| | | fix(treesitter): use the correct replacement args for #gsub! directive
* fix(treesitter): do not track ranges of the root tree (#22912)Lewis Russell2023-04-06
| | | Fixes #22911
* refactor: rename local API alias from a to apiLewis Russell2023-04-05
| | | | | | | | Problem: Codebase inconsistently binds vim.api onto a or api. Solution: Use api everywhere. a as an identifier is too short to have at the module level.
* fix(windows): consistent normalization in fs.finddundargoc2023-04-04
| | | | | | | | | | | vim.fs.find(".luacheckrc") ``` c:\\projects\\neovim/.luacheckrc # before c:/projects/neovim/.luacheckrc # after ``` Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
* refactor(treesitter): move inspect_tree implLewis Russell2023-04-04
|
* docs: fix typosdundargoc2023-04-04
| | | | | | Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: himanoa <matsunoappy@gmail.com>
* refactor(treesitter): delegate region calculation to treesitter (#22576)Lewis Russell2023-04-04
|
* fix(treesitter): use capture metadata range if exists danilax9992023-04-04
| | | use `treesitter.get_range` instead of inline expression
* fix(health): stop using deprecated ts.language.inspect_language() (#22850)Sizhe Zhao2023-04-01
|
* refactor(treesitter)!: rename help parser to vimdocChristian Clason2023-04-01
|
* feat: add `vim.treesitter.language.get_filetypes()` (#22643)Lewis Russell2023-03-30
|
* fix(treesitter): add missing deprecateLewis Russell2023-03-24
|
* feat(treesitter)!: deprecate top level indexes to modules (#22761)Lewis Russell2023-03-24
| | | | | | | | | | | | | | | | | The following top level Treesitter functions have been moved: - vim.treesitter.inspect_language() -> vim.treesitter.language.inspect() - vim.treesitter.get_query_files() -> vim.treesitter.query.get_files() - vim.treesitter.set_query() -> vim.treesitter.query.set() - vim.treesitter.query.set_query() -> vim.treesitter.query.set() - vim.treesitter.get_query() -> vim.treesitter.query.get() - vim.treesitter.query.get_query() -> vim.treesitter.query.get() - vim.treesitter.parse_query() -> vim.treesitter.query.parse() - vim.treesitter.query.parse_query() -> vim.treesitter.query.parse() - vim.treesitter.add_predicate() -> vim.treesitter.query.add_predicate() - vim.treesitter.add_directive() -> vim.treesitter.query.add_directive() - vim.treesitter.list_predicates() -> vim.treesitter.query.list_predicates() - vim.treesitter.list_directives() -> vim.treesitter.query.list_directives() - vim.treesitter.query.get_range() -> vim.treesitter.get_range() - vim.treesitter.query.get_node_text() -> vim.treesitter.get_node_text()
* fix(treesitter): annotationsLewis Russell2023-03-23
| | | | | | - Begin using `@package` in place of `@private` for functions that are accessed internally but outside their defined class. - Rename Node -> TSP.Node
* fix(treesitter): foldexpr (#22652)Lewis Russell2023-03-13
| | | The ranges passed to foldinfo.remove_range were in the wrong order.
* Merge pull request #22613 from lewis6991/feat/tsqueryutilLewis Russell2023-03-11
|\
| * refactor(treesitter): add Range type aliase for Range4|Range6Lewis Russell2023-03-11
| |
| * feat(treesitter)!: consolidate query util functionsLewis Russell2023-03-10
| | | | | | | | | | | | - And address more type errors. - Removed the `concat` option from `get_node_text` since it was applied inconsistently and made typing awkward.
* | feat!(treesitter): do not return changes from LanguageTree:parse() Lewis Russell2023-03-10
|/ | | | | | | | | Never return the changes an only notify them using the `on_changedtree` callback. It is not guaranteed for a plugin that it'll be the first one to call `tree:parse()` and thus get the changes. Closes #19915
* perf(treesitter): more efficient foldexprLewis Russell2023-03-10
|
* fix(treesitter): do not error on empty filetypeLewis Russell2023-03-10
| | | | Ignore instead
* refactor(treesitter): use byte ranges from treesitter (#22589)Lewis Russell2023-03-09
|
* Revert "refactor(treesitter): delegate region calculation to treesitter" ↵Lewis Russell2023-03-08
| | | | | | | (#22575) Revert "refactor(treesitter): delegate region calculation to treesitter (#22553)" This reverts commit 276b647fdba07bf1762d8dd371c4b655b8a418df.
* refactor(treesitter): delegate region calculation to treesitter (#22553)Lewis Russell2023-03-08
|
* feat(treesitter): use upstream format for injection queriesLewis Russell2023-03-08
|
* refactor(treesitter): simplify some range functionsLewis Russell2023-03-06
|
* docs: module-level docstrings (@defgroup) #22498Justin M. Keyes2023-03-05
| | | | | | | | | | | | Problem: gen_vimdoc.py / lua2dox.lua does not support @defgroup or \defgroup except for "api-foo" modules. Solution: Modify `gen_vimdoc.py` to look for section names based on `helptag_fmt`. TODO: - Support @module ? https://github.com/LuaLS/lua-language-server/wiki/Annotations#module
* docs(treesitter): number → integer (#22513)Jaehwang Jung2023-03-04
|
* docs: fix vim.treesitter tagsJustin M. Keyes2023-03-03
| | | | | | | | | Problem: Help tags like vim.treesitter.language.add() are confusing because `vim.treesitter.language` is (thankfully) not a user-facing module. Solution: Ignore the "fstem" when generating "treesitter" tags.
* Merge pull request #22484 from gpanders/inspect-tree-fix-cursorChristian Clason2023-03-03
|\ | | | | fix(treesitter): maintain cursor position when toggling anonymous nodes
| * refactor(treesitter): use string.format to create linesGregory Anders2023-03-02
| |
* | fix(treesitter): typos in _range.luaJaehwang Jung2023-03-03
| | | | | | fix(treesitter): typos _range.lua
* | fix(treesitter): disallow empty filetypesLewis Russell2023-03-03
|/ | | Fixes #22473
* fix(treesitter): fixup for healthLewis Russell2023-02-27
|
* fix(treesitter): ipairs -> pairsLewis Russell2023-02-27
| | | Fixes: https://github.com/nvim-treesitter/nvim-treesitter/issues/4349
* fix(treesitter): remove virtual text from playgroundLewis Russell2023-02-27
| | | Implement the range and lang annotations as comments instead
* feat(treesitter): expand the APILewis Russell2023-02-26
|
* feat(treesitter)!: remove silent option from language.add()Lewis Russell2023-02-24
| | | Simply use `pcall` if you want to silence an error.
* fix(treesitter): fixup language invalidation (#22381)Lewis Russell2023-02-23
|
* feat(treesitter): upstream foldexpr from nvim-treesitterLewis Russell2023-02-23
|
* perf(treesitter): smarter languagetree invalidationLewis Russell2023-02-23
| | | | | | | | | | | | | | Problem: Treesitter injections are slow because all injected trees are invalidated on every change. Solution: Implement smarter invalidation to avoid reparsing injected regions. - In on_bytes, try and update self._regions as best we can. This PR just offsets any regions after the change. - Add valid flags for each region in self._regions. - Call on_bytes recursively for all children. - We still need to run the query every time for the top level tree. I don't know how to avoid this. However, if the new injection ranges don't change, then we re-use the old trees and avoid reparsing children. This should result in roughly a 2-3x reduction in tree parsing when the comment injections are enabled.
* docs: fix more treesitter parsing errorsChristian Clason2023-02-23
|
* docs(treesitter): fix parse errorsChristian Clason2023-02-23
|
* feat(treesitter): add filetype -> lang APILewis Russell2023-02-21
| | | | | | | | | | | | | | | | | | Problem: vim.treesitter does not know how to map a specific filetype to a parser. This creates problems since in a few places (including in vim.treesitter itself), the filetype is incorrectly used in place of lang. Solution: Add an API to enable this: - Add vim.treesitter.language.add() as a replacement for vim.treesitter.language.require_language(). - Optional arguments are now passed via an opts table. - Also takes a filetype (or list of filetypes) so we can keep track of what filetypes are associated with which langs. - Deprecated vim.treesitter.language.require_language(). - Add vim.treesitter.language.get_lang() which returns the associated lang for a given filetype. - Add vim.treesitter.language.register() to associate filetypes to a lang without loading the parser.
* fix(treesitter): make params optionalLewis Russell2023-02-15
|