VSCodeVim / VSCodeVim/Vim

Make search execution asynchronous

Open
#7,572 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/performance area/search
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

#7495 changed the search system to use a timeout (1 second) rather than a cap on the number of matches (1000). This is an improvement for most use-cases but it's still a crappy experience when searching in a large-ish file, since it takes 1 second for each character you type, if there are enough matches.

The solution to this, of course, is to do no real searching within the usual handleKeyEvent callback. If there's an active search for which we haven't scanned the whole document, spawn a task to do that (and populate SearchState.matchRanges or similar), stopping after X millis to spawn an identical task and unblock.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the search flow around the handleKeyEvent callback and the SearchState.matchRanges state, then review issue #7495 for the current timeout behavior. The change is complete when handleKeyEvent no longer performs the full search synchronously, background tasks incrementally populate match ranges, and each task yields after the specified time limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
performance, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.