Commit graph

6 commits

Author SHA1 Message Date
Kiyoon Kim
2c2430d42f deprecate get_node_range and is_in_node_range 2023-02-12 02:38:17 -08:00
Michael Lan
0922634d37
fix(utils): swap_nodes calculates correct char_delta (#4110)
* fix(utils): swap_nodes calculates correct char_delta

The char_delta is not calculated correctly right now when there are two
treesitter nodes being swapped, one directly following the other. This
is rare but can happen for example when attempting to swap "print" and
"(1)" in "print(1)". In this case an incorrect char_delta is calculated
because of a bug in range comparison.

* test(swap_nodes): check cursor

* add a regression test (for multiline node swap)
* add a test with adjacent swaps that fails when char_delta is not
  calculated correctly

* test(swap_nodes): check text content after swap

* test: note language for parser

* fix tests

* use same not equal for table comparison
2023-01-07 02:53:12 +01:00
Axel Dahlberg
0d7fab0c33
feat(ts_utils): allow starting selection after last character (#3233) 2022-07-29 17:35:29 +02:00
Christian Clason
bc25a6a5c4 chore!: remove ensure_installed='maintained'
Removes all support (and tests) for the parser category "maintained", as
this is no longer a useful category.

BREAKING CHANGE: replace `ensure_installed='maintained'` by an explicit
list of parsers, or use `'all'` (not recommended).
2022-04-30 11:42:46 +02:00
Cezary Drożak
e87ed0fdaa feat: add "experimental" key to parsers
feat(ci): mark parsers as experimental in README
2021-10-07 22:43:09 +02:00
partizan
cd4c0a7526
test: Add tests for is_in_node_range (#1756)
* fix: is_in_node_range now includes end line and col

This fixes no indents at the end of python files

Refs #1136

* update scala highlights (#1760)

* add type highlights

* add call expression highlights

* add function definition highlights

* add expression highlights

* add literals highlights

* add operator highlights

* add punctuation highlights

* add comment highlights

Co-authored-by: Stevan Milic <stevan.milic@tradecore.com>

* test: Add unit tests

* Revert "fix: is_in_node_range now includes end line and col"

This reverts commit 5a721fef56.

* refactor test

* apply stylua

* fix luacheck

* update `describe` text

* smallfix

Co-authored-by: Stevan Milic <stevan.milic@yahoo.com>
Co-authored-by: Stevan Milic <stevan.milic@tradecore.com>
2021-08-30 20:18:04 +02:00