Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Smart Block SelectNew to Visual Studio Code? Get it now.
Smart Block Select

Smart Block Select

정건휘

| (0) | Free
Select the nearest enclosing logical block — function, arrow function, if/else, JSX element
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Smart Block Select

Instantly select the nearest enclosing logical block — function, arrow function, if/else, loop, JSX element — with a single keystroke.

Usage

Place your cursor anywhere inside a block, then press:

Platform Shortcut
Windows / Linux Shift+Alt+S
macOS Shift+Alt+S

The entire enclosing block is selected. Press again to expand to the next outer block.

Supported Block Types

  • function declarations and expressions
  • Arrow functions (const fn = () => {} — selects the full const statement)
  • if / else if / else chains
  • for, for...in, for...of loops
  • while and do...while loops
  • JSX elements, self-closing elements, and fragments (<>...</>)
  • return statements

Supported Languages

  • TypeScript (.ts)
  • TypeScript + JSX (.tsx)
  • JavaScript (.js)
  • JavaScript + JSX (.jsx)

How It Works

Smart Block Select uses the TypeScript compiler API to parse your file into an AST (Abstract Syntax Tree) and finds the innermost supported block node containing your cursor. No language server required — it works instantly on any file.

Commands

Command Description
Smart Block Select: Select Block Select the block containing the cursor

Extension Settings

This extension has no configurable settings.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft