tree-sitter / tree-sitter-julia

Julia grammar for tree-sitter
MIT License
95 stars 33 forks source link

Improve block statements and import rules #64

Closed savq closed 1 year ago

savq commented 1 year ago

Closes #13, closes #15, and closes #58 (duplicate) Closes #28 Closes #59

ChrHorn commented 1 year ago

I think it would be better to use block instead of _block. Makes it easier to do tree sitter based selection, for example select only the body of the function etc. That's how it is done for most grammars.

Exception for source_file, there _block should be OK.

savq commented 1 year ago

That's how it is done for most grammars.

Is it? As far as I know, Lua is the only algol-like language that has explicit blocks.

For now, I only wanted to rename to _block to align with Julia terminology and because it's easier to grep/jump to. But I'm not sure about making the rule visible... Neovim manages to match inner blocks, so it's doable.

@ChrHorn, could you open an issue to revisit that idea later?

ChrHorn commented 1 year ago

@ChrHorn, could you open an issue to revisit that idea later?

Will do!