Skip to content

Commit

Permalink
Don't skip setting ignore files when not in a codebase (#2587)
Browse files Browse the repository at this point in the history
Fixes #2586


## Test plan

- Open a folder that is not a Git repo / codebase
- Set `"cody.internal.unstable": true` to enable ignore functionality
- Create a `.cody/ignore` file containing "*.ignore"
- Create files "foo.not" and "foo.ignore"
- Type "@foo" in chat and ensure the `.ignore` file is not shown


![image](https://github.com/sourcegraph/cody/assets/1078012/ce8dea8b-93fa-44b8-aa9d-dcd9cf55c5e9)
  • Loading branch information
DanTup authored Jan 5, 2024
1 parent d6a893f commit 66e5672
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions vscode/src/services/context-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,14 @@ async function refresh(uri: vscode.Uri): Promise<void> {
})
)

if (codebaseName) {
ignores.setIgnoreFiles(wf.uri.fsPath, filesWithContent, codebaseName)
logDebug('CodyIgnore:refresh:workspace', wf.uri.fsPath)
return
}
logDebug('CodyIgnore:refresh:workspace', wf.uri.fsPath)

// Main workspace root
ignores.setIgnoreFiles(wf.uri.fsPath, filesWithContent, codebaseName)
// Nested codebases
for (const cb of codebases) {
ignores.setIgnoreFiles(cb[1], filesWithContent, cb[0])
}
logDebug('CodyIgnore:refresh:workspace', wf.uri.fsPath)
}

/**
Expand Down

0 comments on commit 66e5672

Please sign in to comment.