Skip to content

Add multi-cursor support to select/navigate/move commands#188

Merged
selfint merged 12 commits intoselfint:mainfrom
CB2Moon:feat/multi-select-pr
Oct 31, 2025
Merged

Add multi-cursor support to select/navigate/move commands#188
selfint merged 12 commits intoselfint:mainfrom
CB2Moon:feat/multi-select-pr

Conversation

@CB2Moon
Copy link
Copy Markdown
Contributor

@CB2Moon CB2Moon commented Oct 26, 2025

What: Multi-cursor support for selectBlock, selectParent/Child/Next/Previous, navigate*, and moveUp/Down
How: Iterates over editor.selections; move ordering to avoid conflicts; tests added
Scope: No package manager/config churn; no new commands
Validation: tsc and tests pass; lint unchanged from upstream

CB2Moon and others added 12 commits October 31, 2025 17:58
This commit adds multi-cursor support to selectBlock, updateSelection,
moveSelection, and navigate commands. When multiple cursors or selections
exist, each is processed independently and results are merged intelligently.

Changes:
- selectBlock: Maps over all selections to find blocks at each cursor
- updateSelection: Updates each selection independently (parent/child/next/prev)
- moveSelection: Orders moves to prevent interference, handles single vs multi
- navigate: Collects navigation targets for all cursors
- Add mergeSelections helper to combine overlapping selections
- Add dedupeSelections helper to remove duplicate cursor positions
- Add comprehensive test suite (MultiSelectBlockMode.test.ts)
@selfint selfint force-pushed the feat/multi-select-pr branch from e4fbb04 to e3d9647 Compare October 31, 2025 15:58
@selfint selfint requested a review from Copilot October 31, 2025 16:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the project's dependencies, including major version upgrades to testing frameworks (mocha, chai), build tools (esbuild, typescript), and the tree-sitter library. The changes also include updates to tree-sitter parser files for TypeScript/TSX and Rust, along with code changes to support multi-cursor functionality and improve type safety.

Key changes:

  • Major dependency upgrades: tree-sitter (0.22.0 → 0.25.0), mocha (10.x → 11.x), chai (4.x → 6.x), typescript (5.1.6 → 5.9.3)
  • Added multi-cursor support for block selection, navigation, and movement operations
  • Updated tree-sitter parser files with new grammar features and bug fixes
  • Type safety improvements in Installer.ts and FileTree.ts

Reviewed Changes

Copilot reviewed 32 out of 45 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
yarn.lock Updates all dependency versions
package.json Updates devDependencies and dependencies with version bumps, adds Rust field_declaration query, changes install script to use --frozen-lockfile
tsconfig.json Updates target and lib from ES2020 to ES2022
src/BlockMode.ts Adds multi-cursor support for selectBlock, updateSelection, moveSelection, and navigate functions
src/Installer.ts Improves type safety by properly typing Language and Buffer parameters
src/FileTree.ts Removes unnecessary Language type assertion
src/test/suite/*.test.ts Updates tests to support multi-cursor scenarios and fixes glob API usage
test-parsers/* Updates tree-sitter parser files for TypeScript/TSX and Rust with new grammar features

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

},
"scripts": {
"install:all": "yarn install && cd webview-ui && yarn install",
"install:all": "yarn install --frozen-lockfile && cd webview-ui && yarn install --frozen-lockfile",
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --frozen-lockfile flag is a good addition for CI/CD environments, but this change may cause local development issues if developers need to update dependencies. Consider documenting this behavior change or creating separate scripts for CI vs local development (e.g., install:all:ci for frozen installs).

Suggested change
"install:all": "yarn install --frozen-lockfile && cd webview-ui && yarn install --frozen-lockfile",
// For local development, use 'install:all'. For CI/CD, use 'install:all:ci'.
"install:all": "yarn install && cd webview-ui && yarn install",
"install:all:ci": "yarn install --frozen-lockfile && cd webview-ui && yarn install --frozen-lockfile",

Copilot uses AI. Check for mistakes.
`${npm} pack --verbose --json --pack-destination ${parserDir} ${parserNpmPackage}`,
{},
onData
(d) => onData?.(d.toString())
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callback now receives a Buffer and converts it to string inline. While this works, consider documenting the Buffer-to-string conversion or handling potential encoding issues. The toString() method uses UTF-8 by default, which should be fine for most cases but may fail with non-UTF-8 output.

Suggested change
(d) => onData?.(d.toString())
// We expect npm output to be UTF-8 encoded. If this changes, update the encoding below.
(d) => onData?.(d.toString('utf8'))

Copilot uses AI. Check for mistakes.
@selfint selfint merged commit 82ce179 into selfint:main Oct 31, 2025
10 of 11 checks passed
@selfint selfint added this to the v0.8.0 milestone Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants