Fix Quick Query without an open workspace - #4508
Draft
hugosmoreira wants to merge 2 commits into
Draft
hugosmoreira wants to merge 2 commits into
hugosmoreira wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Why
Without an open workspace,
ExtensionContext.storageUriis undefined. Quick Query currently throwsWorkspace storage path is undefinedbefore 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
2fdf8a30cb79298305cda2a8fd6d903dbdf96882on Windows with Node 22.22.1. It incorporates main at670390b971233d1a8d8980c0e3c38806cc562b20; a merge preview with newer main3d925ba99was 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 isexpandShortPaths > on Windows > should expand multiple short paths, an ENOENT for the fixture'sFOLDER~1path. The same test fails on unchanged base670390b97with 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.npm run build: passed, including extension/webview TypeScript checks and VSIX packaging.npm run lint: passed with zero warnings.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.