Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore all non-file uris by default #2640

Merged
merged 3 commits into from
Jan 9, 2024
Merged

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Jan 9, 2024

CLOSE #2585

Add a check to ignore all non-file URIs in the IgnoreHelper class.

This prevents Cody from using files that cannot be uploaded remotely or defined in ignore files as context, e.g. unsaved files or vs code user configuration files.

This also fixed an issue where opening a non-file URIs would cause autocomplete to stop working

Test plan

  1. Open vs code config as tab as described by @philipp-spiess in https://sourcegraph.slack.com/archives/C05AGQYD528/p1704815009033359
  2. Switch back to a codebase file to make sure autocomplete is still working (unless the file is ignored)
Screen.Recording.2024-01-09.at.7.55.11.AM.mov

@abeatrix abeatrix requested review from philipp-spiess, DanTup and a team January 9, 2024 16:02
Copy link
Contributor

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

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

Great 🤟

Copy link
Contributor

@DanTup DanTup left a comment

Choose a reason for hiding this comment

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

lgtm, but if this doesn't break any tests we should add one 😄

Edit: Apparently we tested everything except non-file URIs...

@abeatrix
Copy link
Contributor Author

abeatrix commented Jan 9, 2024

lgtm, but if this doesn't break any tests we should add one 😄

Edit: Apparently we tested everything except non-file URIs...

good idea lol just added!

@abeatrix abeatrix merged commit 61b01a4 into main Jan 9, 2024
16 checks passed
@abeatrix abeatrix deleted the bee/fix-ignore-non-file branch January 9, 2024 16:23
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.

bug: editing non-file documents with ignore file enabled causes errors
3 participants