MCPcopy Index your code
hub / github.com/antfu/vscode-smart-clicks

github.com/antfu/vscode-smart-clicks @v0.2.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.2 ↗ · + Follow
56 symbols 119 edges 25 files 3 documented · 5% updated 10mo agov0.2.2 · 2025-08-24★ 68916 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Smart Clicks VS Code

Visual Studio Marketplace Version

Smart selection with double clicks for VS Code.

GIF Demo

Usage

Double clicks on the code.

Rules

bracket-pair

Pair to inner content of brackets.

▽
(foo, bar)
 └──────┘

dash

- to identifier.

   ▽
foo-bar
└─────┘

html-attr

= to HTML attribute.

          ▽





     └─────────┘

html-element

< to the entire element.

▽









└────────────────────┘

html-tag-pair

Open and close tags of a HTML element.

 ▽









 └─┘              └─┘

js-arrow-fn

=> to arrow function.

       ▽
(a, b) => a + b
└─────────────┘

js-assign

= to assignment.

        ▽
const a = []
└──────────┘

class B {
    ▽
  b = 1;
  └────┘
    ▽
  ba = () => {};
  └────────────┘
}

js-block

Blocks like if, for, while, etc. in JavaScript.

▽
function () {     }
└─────────────────┘
▽
import { ref } from 'vue'
└───────────────────────┘

This rule is disabled by default.

js-colon

: to the value.

     ▽
{ foo: { bar } }
       └─────┘

jsx-tag-pair

Matches JSX elements' start and end tags.

  ▽
(<Flex.Item>Hi</Flex.Item>)
  └───────┘     └───────┘

Configuration

All the rules are enabled by default. To disable a specific rule, set the rule to false in smartClicks.rules of your VS Code settings:

// settings.json
{
  "smartClicks.rules": {
    "dash": false,
    "html-element": false,
    "js-block": true
  }
}

Commands

ID Description
smartClicks.trigger Trigger Smart Clicks in current cursor position without mouse click

Usage examples:

  1. Command palette

Invoke the command palette by typing Ctrl+Shift+P and then typing Smart Clicks: Trigger.

  1. Keyboard shortcuts

jsonc // keybindings.json { "key": "ctrl+alt+c", "command": "smartClicks.trigger", "when": "editorTextFocus" }

  1. Vim keybindings (VSCodeVim is needed)

jsonc // settings.json { "vim.normalModeKeyBindings": [ { "before": ["leader", "c"], "commands": ["smartClicks.trigger"], } ] }

Sponsors

Credits

Inspired by HBuilderX, initiated by 恐粉龙.

License

MIT License © 2022 Anthony Fu

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 34
Method 10
Interface 8
Class 4

Languages

TypeScript100%

Modules by API surface

playground/main.ts17 symbols
src/types.ts7 symbols
src/context.ts3 symbols
src/utils.ts2 symbols
src/rules/jsx-tag-pair.ts2 symbols
src/rules/js-colon.ts2 symbols
src/rules/js-block.ts2 symbols
src/rules/js-assign.ts2 symbols
src/rules/js-arrow-fn.ts2 symbols
src/rules/index.ts2 symbols
src/log.ts2 symbols
src/index.ts2 symbols

For agents

$ claude mcp add vscode-smart-clicks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page