Fix Copilot Chat not recognizing workspace repos#317192
Open
dhmjhu wants to merge 1 commit into
Open
Conversation
Don't force case-sensitive matching of workspace and repo paths.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Copilot Chat’s workspace-repo detection in CodeSearchChunkSearch by switching workspace/repo URI comparisons to extUriBiasedIgnorePathCase, preventing false “not a GitHub repo” failures caused by Windows drive-letter casing differences in multi-root workspaces (issue #313181).
Changes:
- Use
extUriBiasedIgnorePathCasefor equality and parent/child URI checks when relating indexed repos to workspace folders. - Apply the same comparison strategy consistently across the file (including
openGitReporelevance filtering and repo-location telemetry classification).
Comment on lines
852
to
856
| // Skip repos that aren't relevant to the workspace (e.g. worktrees at external paths) | ||
| const workspaceFolders = this._workspaceService.getWorkspaceFolders(); | ||
| const isRelevantToWorkspace = workspaceFolders.some(folder => | ||
| isEqualOrParent(repo.rootUri, folder) || isEqualOrParent(folder, repo.rootUri)); | ||
| extUriBiasedIgnorePathCase.isEqualOrParent(repo.rootUri, folder) || extUriBiasedIgnorePathCase.isEqualOrParent(folder, repo.rootUri)); | ||
| if (!isRelevantToWorkspace) { |
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.
I modified
openGitRepo()to useextUriBiasedIgnorePathCase, which treats thefile:scheme as case-insensitive when not on Linux. I also changed the other uses ofisEqual()/isEqualOrParent()in the same file to keep things consistent.This should fix #313181, at least partially.
Creating a Codebase Semantic Index was failing with a misleading message about only working on GitHub repos (which mine was). The cause was actually
CodeSearchChunkSearchfailing to recognize the "relevance" of the repo.My workspace's (single) folder was the same directory as the repo. The workspace folder's path in the workspace file had an uppercase drive letter, while the repo path had a lowercase one. Because
CodeSearchChunkSearch::openGitRepo()was performing case-sensitive matching, it did not treat them as equal.