blob42
7efc6653ec
fix for nvim 0.9+
8 months ago
Stephan Seitz
2b81a018a4
fix: only have one source of `get_node_text` (nvim-treesitter.compat)
...
PR #120 used nvim-treesitter.compat in some occasions but not all:
https://github.com/nvim-treesitter/playground/pull/120/files
This made nvim-treesitter-playground incompatible with older
Neovim versions https://github.com/nvim-treesitter/playground/pull/120#issuecomment-1509140602
Although, we generally only support latest Neovim stable this is a
unnecessary inconsistency in the code base. Also when, ts_compat should
be removed in future it should there will be only one source of
`get_node_text` that can then be swapped consistently around the whole
code base. nvim-treesitter-playground is especially useful for older
Neovim versions that don't have the built-in playground yet.
1 year ago
monaqa
934cb4c4ad
fix: pcall vim.treesitter.language.inspect ( #121 )
1 year ago
Tom van Dijk
db54848c7d
fix: update deprecated `vim.treesitter` calls ( #120 )
...
ref: neovim/neovim@cbbf8bd
1 year ago
Stephan Seitz
4044b53c4d
Merge pull request #115 from yutkat/master
...
fix: rename ts_utils.is_in_node_range -> vim.treesitter.is_in_node_range
1 year ago
Yuta Katayama
f626642261
fix: rename ts_utils.is_in_node_range -> vim.treesitter.is_in_node_range
1 year ago
Stephan Seitz
c046acba26
Merge pull request #117 from otommod/use-diagnostics
...
feat(query_linter): add new option use_diagnostics
1 year ago
Otto Modinos
f2ae937170
fix: stylua
1 year ago
Otto Modinos
a3757e6210
feat(query_linter)!: remove use_virtual_text
...
I believe `use_diagnostics` is superior in every way
1 year ago
Otto Modinos
d1fb4bf0fd
refactor(query_linter): do all the decorations in one place
...
This also replaces the apparently deprecated `nvim_buf_set_virtual_text`
with `nvim_buf_set_extmark`
1 year ago
Otto Modinos
1445e0c01e
feat(query_linter): add new option use_diagnostics
...
Adds a new option (enabled by default) for the query_linter that uses
the builtin `vim.diagnostic` "framework" to display any errors found.
Disable `use_virtual_text` by default.
1 year ago
Stephan Seitz
c481c660fa
Merge pull request #114 from nvim-treesitter/hl-groups
...
fix: highlight groups are off by one
1 year ago
ObserverOfTime
dcfd1f9974
fix: highlight groups are off by one
1 year ago
Stephan Seitz
c19bcfd6a3
Merge pull request #113 from ghostbuster91/note-linter
...
Add note about query linter assumptions
1 year ago
ghostbuster91
64376e2ffb
docs: Add note about query linter assumptions
1 year ago
figsoda
01c27f37a1
fix: peacefully ignore query files without a valid language
1 year ago
figsoda
b411a5c772
docs: mention `query` grammar in requirements
1 year ago
Jeremy Goh
926d0f9411
docs: mention `:TSNodeUnderCursor` in readme
1 year ago
Stephan Seitz
8a887bcf66
Merge pull request #107 from kraem/fix/on_query_cursor_move-use-current-buf
...
fix: use current buf for get_node_text in on_query_cursor_move
1 year ago
kraem
1d392660f3
fix: use current buf for get_node_text in on_query_cursor_move
1 year ago
Stephan Seitz
9050dca056
Merge pull request #105 from theHamsta/remove-deprecation
...
chore: replace deprecated ts_utils.get_node_text
1 year ago
Stephan Seitz
632b649a37
chore: replace deprecated ts_utils.get_node_text
...
Fixes #101
1 year ago
dundargoc
3421bbbfec
ci: bump action versions
1 year ago
Christian Clason
1290fdf6f2
ci: update stylua action
1 year ago
Christian Clason
19bdbb657d
docs: don't commit huge demo gif
1 year ago
Christian Clason
e6a0bfaf9b
fixup: lint
2 years ago
Christian Clason
e98525259c
fixup: include @ in capture name
2 years ago
Christian Clason
546d2df7c1
fix: show captures == hlgroups in playground
2 years ago
Stephan Seitz
bcfab84f98
fix: handle errors in query editor ( #93 )
...
Fixes #86
2 years ago
Stephan Seitz
49e5dd2b6c
fix: update tree-sitter mappings ( #92 )
2 years ago
Stephan Seitz
90d2b3e172
Merge pull request #87 from aarondiel/highlight-fallback
...
fix(fallback for show_hl_captures)
2 years ago
Christian Clason
a0aeb6af82
fix: adapt to breaking change on master ( #90 )
...
This is a stop-gap fix to avoid errors on latest master after neovim/neovim#19931
This at least gives useful information (the capture name, albeit without leading @), but a full rewrite is needed once nvim-treesitter decides on how to handle the upstream changes to highlight group names.
2 years ago
aarondiel
e03ba6cb60
fix(fallback for show_hl_captures)
2 years ago
mohsen
ce7e4b7575
fix: check for nil last line ( #83 )
...
prevent error when focusing playground after closing buffer
2 years ago
Christian Clason
71b00a3c66
fixup: use new api for keymap ( #78 )
2 years ago
Christian Clason
dd250b05d4
feat!: update to Neovim 0.7 APIs ( #75 )
2 years ago
Pedro Castro
13e2d2d63c
feat: add TSNodeUnderCursor ( #74 )
...
add `hl-info.show_ts_node({opts})` to show tree-sitter node under cursor, exposed via `:TSNodeUnderCursor`
2 years ago
Christian Clason
7dbcd4d647
fix(playground): show highlight groups ( #71 )
2 years ago
Santos Gallegos
0198ef4a0c
Pass the query_bufnr explicitly to get_node_text ( #73 )
...
Fixes https://github.com/nvim-treesitter/playground/issues/53
2 years ago
Santos Gallegos
9df82a27a4
Fix local hl on `:TSHighlightCapturesUnderCursor` ( #61 )
...
This code depended on an internal cache that stored the names,
but it was changed to store the id 2460f0a702
.
There is `nvim_get_hl_by_id`, but that doesn't return the name (just the
final values of the colors). So, I'm just duplicating this part 6a92a53c02/runtime/lua/vim/treesitter/highlighter.lua (L81-L93)
Fixes https://github.com/nvim-treesitter/playground/issues/60
2 years ago
Stephan Seitz
787a7a8d44
Merge pull request #56 from dskleingeld/master
...
playground keybindings no longer recursive, fixes #52
3 years ago
dskleingeld
1eca93284f
playground keybindings no longer recursive, fixes #52
3 years ago
Stephan Seitz
deb887b3f4
Merge pull request #50 from theHamsta/hl-info-improvements
...
Improvements for TSHighlightCapturesUnderCursor
3 years ago
Stephan Seitz
cc663ee53b
Improvements for TSHighlightCapturesUnderCursor
...
- show priority
- show both syntax and tree-sitter if both are enabled
3 years ago
Santos Gallegos
2715d35f27
Query linter: update queries
...
This is to match https://github.com/nvim-treesitter/tree-sitter-query/pull/15
3 years ago
Santos Gallegos
d9a9b44e6d
Playground: check for nodes out of range (EOF)
...
The playground will try to set the cursor
to an invalid position (nvim_win_set_cursor) if the node starts at the EOF mark.
```ruby
def run
a = <<~EOF
end
```
3 years ago
Stephan Seitz
6e0037c974
Merge pull request #46 from stsewd/fix-typo
...
Fix typo
3 years ago
Santos Gallegos
ed84d83a3a
Fix typo
3 years ago
Stephan Seitz
1dcdf85258
Merge pull request #44 from stsewd/hint-how-to-use
...
Hint how to use the query editor
3 years ago
Stephan Seitz
13cf5d3788
Merge pull request #45 from stsewd/avoid-crash
...
Avoid crash: check if the buffer is loaded before calling win_findbuf
3 years ago