Big refactor of action handling
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Here's a tentative game plan. The goal of this is to reduce the inconsistency and weirdness in the boundary between ModeHandler and actions, particularly when it comes to multiple cursors.
Stop returningVimStatefrom actions. It's not immutable, and it's clear that it's being altered. IMO this is just noise.- Stop passing
Positionto actions. This should always bevimState.cursorStopPosition, and it's clearer if this is used directly. - Unify
exec,execAction, etc.execCount, unless I'm mistaken, should be inModeHandler. - Rename
RangetoCursorand add extra data to it (desiredColumn, etc.). Some usages ofRangeactually do just refer to a range - these can usevscode.Range.
The hope is that after this, actions will have an exec method that can just be called with each cursor, and nobody will really have to worry about the details of what's going on behind the scenes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing ModeHandler, actions, exec/execAction, execCount, Position, and Range usages to understand the current action boundary and multiple-cursor flow. The refactor is done when actions expose a unified exec method per cursor, no longer receive redundant state or position data, and Range is separated from cursor-specific data as described in the plan.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100