Skip to content

Make _block a visible scope #73

@ChrHorn

Description

@ChrHorn

Most languages make their blocks inside functions, classes, etc visible.

  • end: Lua, Ruby (this was changed recently issue/PR)
  • indent: Python
  • {}: 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 have source_file, so an additional scope is not needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions