Skip to content

Fix Quick Query without an open workspace - #4508

Draft
hugosmoreira wants to merge 2 commits into
github:mainfrom
hugosmoreira:agent/quick-query-without-workspace
Draft

hugosmoreira wants to merge 2 commits into
github:mainfrom
hugosmoreira:agent/quick-query-without-workspace

Conversation

@hugosmoreira

@hugosmoreira hugosmoreira commented Aug 10, 2026

Copy link
Copy Markdown

What

  • Use workspace storage for Quick Query when available, falling back to extension-global storage when no workspace is open.
  • Preserve existing query files and propagate filesystem errors.
  • Cover both directory selection and the existing warning flow in an empty VS Code window.
  • Document the user-facing fix in the changelog.

Why

Without an open workspace, ExtensionContext.storageUri is undefined. Quick Query currently throws Workspace storage path is undefined before reaching its intended guidance. This fallback lets that guidance appear; it does not remove the existing multi-root-workspace reload requirement or change query execution.

Fixes #1415.

Validation

Rechecked saved integration commit 2fdf8a30cb79298305cda2a8fd6d903dbdf96882 on Windows with Node 22.22.1. It incorporates main at 670390b971233d1a8d8980c0e3c38806cc562b20; a merge preview with newer main 3d925ba99 was clean. The newer dependency/build-tool changes are not included in these local results; current-base compatibility remains for PR CI.

  • npm run test:unit -- --runInBand --runTestsByPath test/unit-tests/local-queries/quick-query.test.ts: 4 passed. Covers global fallback, workspace preference, preserving existing contents and filesystem-error propagation.
  • npm run test:vscode-integration:no-workspace -- --runInBand --testPathPatterns=local-queries: 11 passed in 4 suites, VS Code 1.138.0. The new test invokes Quick Query in the real empty-window harness and observes the existing warning using a spy that cancels the prompt; it does not accept a workspace reload or run a query.
  • npm run test:unit -- --runInBand: 636 passed, 1 failed. The failure is expandShortPaths > on Windows > should expand multiple short paths, an ENOENT for the fixture's FOLDER~1 path. The same test fails on unchanged base 670390b97 with the same runtime and lockfile. The earlier complete baseline run had 632 passes and this same single failure; the baseline failing module was rechecked for publication. This is not an all-green Windows unit suite.
  • Original-behavior controls from the saved verification: restoring the workspace-only helper makes the missing-workspace unit regression fail, and makes the real-VS-Code warning test fail with the reported storage-path error. Restoring the fallback makes both pass. These controls were retained and reviewed, not repeated during publication.
  • npm run build: passed, including extension/webview TypeScript checks and VSIX packaging.
  • npm run lint: passed with zero warnings.
  • Prettier check on all five changed files and git diff --check: passed.

Linux/macOS, full view/CLI-integration suites and the post-reload query-execution flow were not run locally. No API key is needed for the focused acceptance path. No tests, assertions or checks were disabled to obtain these results.

AI assistance: Codex assisted with implementation, test development and verification.

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.

Bad error when opening quick query without a workspace folder.

1 participant