Conversation
The _discoverFromFilesystem() method in VisualStudioDataAccess recursively scanned the user's home directory (depth 7) looking for .vs/ directories. On macOS and Linux, Visual Studio does not exist and .vs/ directories are never created, so this scan was traversing thousands of directories synchronously -- causing the extension to hang on startup. Fixes: #611 (related: #493) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
Fixes #611 (related: #493)
On macOS and Linux, the extension was hanging on startup from version 0.0.22 onwards. The last log entry before the hang was:
Root Cause
VisualStudioDataAccess._discoverFromFilesystem()performs a recursive filesystem scan of the user's home directory at depth 7, looking for.vs/copilot-chat/sessions/paths (Visual Studio project directories).On macOS and Linux, Visual Studio doesn't exist —
.vs/directories are never created. However, the scan still walked through all subdirectories of~/synchronously usingreaddirSync, which on a typical developer machine (with many workspaces and deeply nested project trees) caused the extension to appear completely frozen.Fix
Add an early-exit guard at the top of
_discoverFromFilesystem():Visual Studio is a Windows-only application (Visual Studio for Mac was discontinued). There are no
.vs/session directories to find on macOS or Linux, so the scan is skipped entirely on those platforms. The log-based discovery path (_discoverFromLogs) is unaffected — it already exits early when the%LOCALAPPDATA%\Temp\VSGitHubCopilotLogsdirectory doesn't exist.Testing
tsc --noEmit— 0 errors)node esbuild.js)