-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make _block
a visible scope
#73
Comments
This modification will be very welcome for Emacs. I am trying to design a Julia major mode (https://github.com/ronisbr/julia-ts-mode) and without this feature the automatic indentation will not work very well. For example, if we type: function test(a)
end And then press enter after |
I see this has the label "help wanted". What is involved here? It seems like this could be as simple as adding I don't know much about the build setup for this repo, but I am happy to try to take a stab at this if I can get some information about what is involved in going from making a change in |
Updating the grammar is very simple. It just requires renaming The repo follows the usual structure for a tree-sitter grammar (see Creating parsers). The generated stuff in |
|
Most languages make their blocks inside functions, classes, etc visible.
end
: Lua, Ruby (this was changed recently issue/PR){}
: C++, Rust, ...This added visible scope would make targeting the inside/body of a function much easier. Textobjekt queries that do this are currently very cumbersome to do.
The other advantage is tree-sitter based expanding/shrinking selection. Currently it is
expression -> whole function
with this change it would be
expression -> function body -> whole function
It would be much easier to select these code blocks without selecting the surrounding syntax.
I think just changing everything to
block
should be fine. The exception would be the top scope. Here we already havesource_file
, so an additional scope is not needed.The text was updated successfully, but these errors were encountered: