TerminalFi / LSP-copilot

GitHub Copilot support for Sublime Text LSP plugin provided through Copilot.vim.
658 stars 24 forks source link

.copilotignore extension wide, folder independent #175

Open TerminalFi opened 3 months ago

TerminalFi commented 3 months ago

When working on the .copilotignore feature, one thing I kept going back to is why does this have to be a file in a folder. Why can't we support a plugin setting that is a blanket setting.

This is most useful when being present with files which are common across projects. But not necessarily containing a .copilotignore file.

I am thinking that we just implement a setting

.copilotignore which just mimics what a file might contain.

{
    "settings": {
        ".copilotignore": [
            ".env",
            ".envrc",
            "**/*/application.dev.yaml"
        ]
    }
}

I don't see much reason to not support this other than the consider added complexity or maintenance.

I don't see an issue with adding a feature that VS Code Copilot doesn't have, since they already have partial support of copilotignore files and most reports by people say it's only for enterprise

jfcherng commented 3 months ago

Can .copilotignore un-ignored file patterns? E.g., in .gitignore,

*
!foo

This will ignore everything excepts foo.


What are the final patterns if both settings and .copilotignore both exist?

TerminalFi commented 3 months ago

No, we aren't supporting the same logic as .gitignore. In fact, we don't even support comments today. Which we probably should.

I don't think we need to be super complex, I just believe this would give an easy way to just have global setting.

As for the final patterns, since I don't believe we need to support things identical to .gitignore, we could just use a set to get unique values then store them normally.