mattickx / copilotignore-vscode

Disable copilot extension when certain files are open listed in a .copilotignore file
MIT License
14 stars 4 forks source link

.copilotignore file in remote workspace is not loaded #7

Open rgr21 opened 1 week ago

rgr21 commented 1 week ago

Problem: .copilotignore works for local development, but currently fails for remote / container based development.

https://github.com/mattickx/copilotignore-vscode/blob/af741e84ff48ffb0875e489b6ccf9e40b041eddd/src/extension.ts#L76 the readFileSync call is to a local file system.

Switching that to vscode.workspace.fs.readFile (which has a few knock on consequences) would mean that this works for either a local or remote workspace.

If such a change would be acceptable, I can provide a PR that tries to fix this.

mattickx commented 4 days ago

This looks good to me at first sight. Could you specify what knock on consequences this brings on besides now working in remote workspaces?

I haven't tested the implementation yet, I'll do this monday evening (CET). Thanks for the PR!

rgr21 commented 4 days ago

Should have no impact if code is local, works as before. If developing remotely (container or ssh etc) this will read an ignore file that is next to the remote source code.