Comments (5)
Does it depend on :h syntax
? You can check with :set syntax=on
from nvim-treesitter-textobjects.
I don't think i has anything to do with :set syntax=on
. I tried with on and off. The extension is only 100 lines, it should be easy to see what it does https://github.com/tpope/vim-commentary/blob/master/plugin/commentary.vim
For example:
function example(): number {
return 42;
}
I can comment it on and off as a sentence with gcas
, but as a function gcaf
it only toggles on, not off again.
from nvim-treesitter-textobjects.
Does treesitter even know that commented out code is a function? I tried that with https://github.com/terrortylor/nvim-comment and it comments function right but won't properly uncomment it.
You can try to do something like:
gcaf
to comment function
on commented out block do:
vaf
to see that it is not visually selecting around function as you would expect. It is then just commented something, rather than code.
from nvim-treesitter-textobjects.
I tried vaf
, it no longer knows it is a function! I thought that might be the case.
I am not sure the best way to solve this. I tried the @comment.outer
functionality in TypeScript, but unfortunately it seems to do nothing. I assume the ultimate solution is that treesiiter knows what is inside a comment, and can act on that somehow.
from nvim-treesitter-textobjects.
This is because tree-sitter parses the code to get the objects, when you comment the function, tree-sitter doesn't parse it as a function, but as a comment. You should use gcgc
to uncomment tree-sitter text objects instead.
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.