Skip to content

Show "did you mean" suggestions live, before Enter, when the query matches nothing #84

Description

@dawsbot

Problem

The extension has a nice "did you mean" fallback (getClosestMatches in src/closest-match.ts: subsequence + Damerau-Levenshtein), but in practice users almost never see it.

findRelativePath() in src/extension.ts has two picker paths:

  • Quick-filter path (allowQuickFilter — the common case, any workspace under relativePath.searchCountLimit, default 10,000 files): uses window.showQuickPick. VS Code does the live filtering, and when the typed value matches nothing it shows its native empty state. getClosestMatches is never called here.
  • Input-box path (>10k files): the closest-match fallback runs, but only after the user presses Enter.

So while you're typing and there are zero matches, you just get an empty list. The "looks like" / Levenshtein suggestions should kick in as soon as matches hit zero, without pressing Enter.

Expected

In the quick-filter picker, when the current query matches no file, show the getClosestMatches suggestions live (after a short debounce) under a "did you mean" separator, without requiring Enter.

Notes

  • window.showQuickPick is fire-and-forget with no live-typing hook; this needs a managed window.createQuickPick() + onDidChangeValue.
  • Keep VS Code's native fuzzy filtering/highlighting on for the happy path; only inject suggestions when the query would otherwise be empty (i.e. it is not a subsequence of any candidate's relative path).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions