summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/ts_utils.lua
AgeCommit message (Collapse)Author
2022-08-06nil check for linesray-x
2022-07-29feat(ts_utils): allow starting selection after last character (#3233)Axel Dahlberg
2022-04-21fix(ts_utils): fix swap_nodes after get_node_text changefrancisco souza
After some discussion, it looks like the easiest thing to do for now is to keep a private copy of get_node_text (just to skip the deprecation message) and invoke that, until core provides an equivalent function that can return the node content in a table representing the node "lines". Also fixes the statusline by calling the private version for get_node_text until a change is made in core.
2022-04-18fixup: restore old implementationChristian Clason
2022-04-18chore: deprecate ts_utils.get_node_textStephan Seitz
2022-04-16remove ignore_child_trees from get_node_at_positionMarcus Caisey
2022-04-16add ignore_injected_langs to get_node_at_cursorMarcus Caisey
2022-02-03fix(utils): adjust truncation conditionMichael Lan
2022-01-15fix(util): pass offset_encoding to apply_text_editsChristian Clason
Offset encoding is a mandatory argument to `vim.lsp.util.apply_text_edits` since https://github.com/neovim/neovim/commit/bc722c8a74766e14aff3a8e2fc46db72ed864053 Since we are always within a Neovim context, we can just pass `"utf-8"`.
2022-01-08Fix get_node_textMDeiml
2022-01-04Fix: Account for winnr being nil in calls to get_node_at_cursorWil Thomason
2021-12-20goto_node: normalize range for nvim_win_set_cursorSantos Gallegos
Looks like neovim doesn't accept -1 on nvim_win_set_cursor. It's listed as an exception on `:h api-indexing`. Fixes https://github.com/nvim-treesitter/nvim-treesitter-textobjects/issues/149
2021-11-12feat: get node at cursor of other winFabian David Schmidt
2021-09-24Use vim-range style (1-index based) when possible (#1841)Santos Gallegos
https://github.com/nvim-treesitter/nvim-treesitter/pull/1829 half fixed incremental selection for the vim parser, but other bugs still remain (infinite selection and skip selecting the root node). Problems can be replicated with these two files: (missing selecting the root node) ```vim set scrolloff=7 set scrolloff=7 ``` (infinite loop) ```vim set scrolloff=7 ``` The main problem is that we try to map the current selection range to a TS range, but the TS range of a node could include the EOL/EOL marks so it's impossible to know when to change the vim range to match the TS range, is more easy to transform the TS range to a vim range and do the comparison.
2021-09-19Fix incremental selection for nodes that include EOLSantos Gallegos
From `:h setpos()` > If "col" is smaller than 1 then 1 is used. This can be tested with incremental selection on a vim file. ```vim set title ```
2021-07-04Use stylua for autoformat code (#1480)Santos Gallegos
2021-03-30refactor(all): language tree adaption (#1105)Steven Sojka
2021-02-27chore: remove useless code and indent fileskiyan
2021-02-21Add "v", "V", "<C-v>" as valid options of `selection_mode`.echasnovski
2021-02-21Add `selection_mode` argument to `ts_utils.update_selection()`.echasnovski
2021-01-08removed async changedtickBrian Shu
2021-01-08async buf_attachBrian Shu
2021-01-07removed async changedtickBrian Shu
2021-01-07async buf_attachBrian Shu
2020-11-23fix: update interface following languagetree merge (#687)Thomas Vigouroux
2020-10-19Treesitter indentkiyan42
also fixes the memoize_by_buf_tick function
2020-08-31feat(refactor.navigation): add navigation.goto_{next,previous}_usageStephan Seitz
2020-08-17Textobjects: set jump before going to adjacent_textobjectStephan Seitz
2020-08-17Textobjects: add swap featureStephan Seitz
2020-08-13fix(definitions): optimize and fix definition highlightingSteven Sojka
2020-07-27configs: attach on unknown parsers tooThomas Vigouroux
2020-07-20Fix #206: Use lsp.util.apply_text_edits for smart_renameStephan Seitz
2020-07-20Fixed to use normal! instead of normalSteve Vermeulen
2020-07-16Refactor locals.lua:Stephan Seitz
- shared query group stuff -> query.lua - local-specific stuff from ts_utils -> locals.lua
2020-07-16fix(ts_utils): be sure to parse to get rootThomas Vigouroux
Be sure to call `parser:parser()` to get a tree instead of getting the tree directly. This will not cost anything is the buffer is freshly parsed. Fixes #181
2020-07-15feat(textobjects): Add `start` to include preceding things like documentationStephan Seitz
2020-07-14Add textobjects moduleStephan Seitz
2020-07-13Add ts_utils.highlight_nodeStephan Seitz
2020-07-08fix(refactor): highlight def perf issue fixSteven Sojka
2020-07-05Make luacheck happyStephan Seitz
2020-06-30refactor(refactor): use higher local apis and some cleanupSteven Sojka
2020-06-30feat(refactor): add definition navigation moduleSteven Sojka
2020-06-30feat(refactor): add smart rename moduleSteven Sojka
2020-06-30feat(refactor): highlight usages moduleSteven Sojka
2020-06-19add winnr to get_node_at_cursorkiyan42
2020-06-19refacto: remove buf_statekiyan42
- remove buf_state and related code - add get_node_at_cursor() - better incremental selection (code is localized)
2020-05-12refacto/feat: better handling of parser updateskiyan42
features: - node_movement is moving between scopes. - add selection initialization from normal mode - add a decremental selection improvements: - attach to buffer to run tree parsing on change - run state update on CursorMoved - the buffer state is: ``` { cursor_pos = { row=row, col=col }, current_node = node_under_cursor, selection = { range = nil, -- activates when starting a selection nodes = {} -- filling up when starting an incremental selection }, parser = parser, -- parser for current buffer } ``` - refacto all the modules reliant on parsing the tree, update the current nodes, get the current nodes... fixes: - fix has_parser to look for .so libraries - fix should select the whole file when selection root in selection