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

Support nested ignore files #1634

Merged
merged 10 commits into from
Nov 11, 2023
Merged

Support nested ignore files #1634

merged 10 commits into from
Nov 11, 2023

Conversation

DanTup
Copy link
Contributor

@DanTup DanTup commented Nov 4, 2023

Test plan

@DanTup
Copy link
Contributor Author

DanTup commented Nov 10, 2023

@abeatrix these tests are all green now (although there's a TODO about which URI the Ignore tests should be using).

I had a quick test and creating an ignore file did exclude files from the automatic context. I couldn't get the file selection at the bottom of chat working though, it seems to require the app (which I understand isn't available on Windows?)

@DanTup DanTup changed the title WIP: Support nested ignore files Support nested ignore files Nov 10, 2023
@abeatrix
Copy link
Contributor

@DanTup thank you so much for fixing the tests, and getting nested ignore file to work in less than a day 🤯

Regarding the file selection at the bottom below the chat, it doesn't required App to work iirc. It gets updated to whatever file you're currently on but it's not being sent to the llm. I can look into it more on Monday unless you are referring to something else?

Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

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

LGTM! I love how well documented everything is in your code, something I really need to learn from you! I can look into the file selection thing more on Monday plus I know you're about to start on the plg work soon, so feel free to merge this whenever, and we can put this behind a feature flag for internal users and other clients to dogfood, what do you think?

const candidates = Array.from(this.workspaceIgnores.keys()).filter(workspaceRoot =>
filePath.toLowerCase().startsWith(workspaceRoot.toLowerCase())
)
// If this file was inside multiple workspace roots, take the shortest one since it will include
Copy link
Contributor

Choose a reason for hiding this comment

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

🧠

@DanTup
Copy link
Contributor Author

DanTup commented Nov 11, 2023

Regarding the file selection at the bottom below the chat, it doesn't required App to work iirc. It gets updated to whatever file you're currently on but it's not being sent to the llm. I can look into it more on Monday unless you are referring to something else?

I tested the automatically file selection - that seemed to work (the "Read 3 files" but excluded my current file after I added to the ignore list). However there was another button underneath that seemed like it was to let me manually select the files, but I couldn't get it to work (it said it wanted the app). I might have misunderstood that functionality though.

I'll merge this into your branch and let you add the feature flag before merging to master then. If I run out/get blocked on PLG stuff I can finish if needed. Let me know if you have an issues/questions with the bits I did.

Some tests I hadn't written yet but thought would be valuable (probably they'd need to be integration tests):

  • Ensure the VS Code parts are setting up the watcher correctly (verify a file that's not ignored, modify the ignore file on disk, verify it's now ignored)
  • Ensure the VS Code parts are updating when workspace changes (open a workspace, add an extra workspace folder using vscode.workspace.updateWorkspaceFolders, ensure the ignores for files in the second workspace are correct)

@DanTup DanTup marked this pull request as ready for review November 11, 2023 10:55
@DanTup DanTup merged commit 3ee3520 into bee/codyignore Nov 11, 2023
26 checks passed
@DanTup DanTup deleted the dantup/codyignore branch November 11, 2023 10:56
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.

None yet

2 participants