Comments (15)
Sorry, my bad. Didn't install TreeSitter parser (TSIntall
) :D. After installation, it worked.
:TSTextobjectSelect @function.outer
actually showed me the error. Thanks @theHamsta
from nvim-treesitter-textobjects.
Did anyone manage to solve this bug? Select does not work for me as well
from nvim-treesitter-textobjects.
@sozomon i had the problem because i put the config in the lua/plugin
directory instead of after/plugin
. Now everything works.
from nvim-treesitter-textobjects.
So none of the combinations daf
(delete a function) vaf
(select a function) would work for? Not even the go-to commands?
from nvim-treesitter-textobjects.
Yes, none of those work. It just puts me into visual mode (no cursor movement) or waits for a text object. The go tos dont work either
from nvim-treesitter-textobjects.
@kvietcong did you fix this? It happens to me as well sometimes, although for me swap
doenst work, but move
does. I dont think I changed anything.
from nvim-treesitter-textobjects.
@dmatos2012 Sadly I have not been able to fix this. I haven't tested this yet but this might be a Windows problem. I'll have to test it out on Linux later
from nvim-treesitter-textobjects.
I have same problem. I defined mapping with config below but swap
and lsp_interop
are not defined at all - cannot see it in mappings. Only select
andmove
seem to work fine ๐ค
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = { ["<leader>z"] = "@parameter.inner" },
swap_previous = { ["<leader>Z"] = "@parameter.inner" },
},
lsp_interop = {
enable = true,
border = "none",
peek_definition_code = {
["<leader>df"] = "@function.outer",
["<leader>dF"] = "@class.outer",
},
},
}
from nvim-treesitter-textobjects.
Yeah even after removing swap and lsp_interop, it sadly doesn't work
from nvim-treesitter-textobjects.
Same for me, lsp_interop peek_definition doesn't work since many days now :/
selection is ok though
--- https://github.com/nvim-treesitter/nvim-treesitter
require('nvim-treesitter.configs').setup({
ensure_installed = 'maintained',
highlight = {
enable = true,
},
playground = {
enable = false,
},
indent = {
enable = true,
},
textobjects = {
lsp_interop = {
enable = true,
border = 'rounded',
peek_definition_code = {
['df'] = '@function.outer',
['dF'] = '@class.outer',
},
},
select = {
enable = true,
lookahead = true,
keymaps = {
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
},
autopairs = {
enable = true, -- check for autopairs (see nvim-autopairs)
},
-- https://github.com/nvim-treesitter/nvim-treesitter-refactor
refactor = {
highlight_definitions = {
enable = true,
},
smart_rename = {
enable = true,
keymaps = {
smart_rename = 'R',
},
},
navigation = {
enable = true,
keymaps = {
goto_definition_lsp_fallback = 'gnd',
list_definitions = 'gnD',
list_definitions_toc = 'gO',
goto_next_usage = '<a-*>',
goto_previous_usage = '<a-ยต>',
},
},
},
})
from nvim-treesitter-textobjects.
@artemrakov Even, :TSTextobjectSelect @function.outer
wouldn't work for you?
from nvim-treesitter-textobjects.
I have the same problem. With the defaullt config taken from the README neither daf
, dif
, vaf
or any other binding works. Running :TSTextobjectSelect @function.outer
directly does work as intended.
from nvim-treesitter-textobjects.
^^ Yep, same issue. Command works. But binds from the readme are broke.
from nvim-treesitter-textobjects.
@Nimmidev Fixed after reinstalling treesitter cargo cli. Idk why it did not work on last reinstall
from nvim-treesitter-textobjects.
Closing as many people resolved the issue. Feel free to reopen
from nvim-treesitter-textobjects.
Related Issues (20)
- key, value textobjects don't work HOT 4
- FR: Confusion about filetype=sh, and treesitter language bash
- change inside function(@funcion.inner) doesn't work after first time HOT 1
- Is there any way to only select function signaure? HOT 1
- Nim parser fails at compiling and installs incorrectly HOT 7
- error on perl files HOT 1
- Rust @function.outer breaks with indentation HOT 1
- Swap Keymaps Not Being Used in TypeScript, Javascript, or Ruby Buffers HOT 4
- Allow multiple queries for `select` to increase configurability
- Richer Nix queries
- after nvim-treesitter/nvim-treesitter#6024, `nvim-treesitter-textobject` started showing errors HOT 1
- Scope locals not correct for lua files
- The `move` function is very slow on some large cpp files HOT 2
- Add `set_jumps` option to `select` module
- Delete @function.outer deletes more than it should HOT 3
- Errors on Fennel files; need to update queries HOT 1
- nvim-treesitter.textobjects.repeatable_move is not found HOT 1
- Built in textobjects table is hard to read
- Assignment operator do not exist for c/cpp HOT 12
- Select Mode Keymaps appear broken HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-treesitter-textobjects.