Skip to content

Fix Copilot Chat not recognizing workspace repos#317192

Open
dhmjhu wants to merge 1 commit into
microsoft:mainfrom
dhmjhu:copilot-workspace-path-case
Open

Fix Copilot Chat not recognizing workspace repos#317192
dhmjhu wants to merge 1 commit into
microsoft:mainfrom
dhmjhu:copilot-workspace-path-case

Conversation

@dhmjhu
Copy link
Copy Markdown

@dhmjhu dhmjhu commented May 18, 2026

I modified openGitRepo() to use extUriBiasedIgnorePathCase, which treats the file: scheme as case-insensitive when not on Linux. I also changed the other uses of isEqual()/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 CodeSearchChunkSearch failing 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.

Don't force case-sensitive matching of workspace and repo paths.
Copilot AI review requested due to automatic review settings May 18, 2026 22:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 extUriBiasedIgnorePathCase for equality and parent/child URI checks when relating indexed repos to workspace folders.
  • Apply the same comparison strategy consistently across the file (including openGitRepo relevance 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) {
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.

Codebase Semantic Index does no longer work on multi-root workspaces

3 participants