fix: make root directory detection dynamic#213
fix: make root directory detection dynamic#213zbirenbaum merged 14 commits intozbirenbaum:masterfrom
Conversation
This reverts commit 587fbeb.
|
@zbirenbaum sorry to ping you twice in one day I am getting lots of duplicate client errors now |
This reverts commit 7593549.
No worries. I didn't run into an issue testing but I was a little apprehensive about this patch since detection can really mess things up historically. I reverted it just now and will review this patch and detection in general more later. |
|
Not that you needed any more validation, but just in case I can provide any information - the revert of this fixed my situation as well. I noticed the problem a while back (a few months, which makes tons of sense now) but didn't do much research because I just uninstalled temporarily and moved on with my life, thinking I'd take a look later. When I finally came back to it this weekend and tried to dig in I gathered the information I could. While I was troubleshooting I ran the Lazy.nvim 'update all' command several times and didn't get the patch. As I dug in further I decided to update just copilot.lua directly (lowercase "u" in the Lazy.nvim UI) and THAT caused it to pick this patch up 🤷 . Let me know if you'd like the notes I took about what I was seeing and all of the things I went through and tried if it will help you when you do come back to this someday! Thanks for the work on this plugin - massively appreciated. |
|
It is not necessary to depend on Meaning, setting Here is how As s side note, to get the root_dir = function(start)
return vim.fs.dirname(vim.fs.find(".git", { path = start, upward = true })[1])\
end(of course, the search pattern, i.e. |
Fixes #212
Instead of calling
vim.loop.cwd()when the plugin is initialized, this pull request calls whatever function is stored in the config asget_rootevery time the LSP attaches to a buffer. I've set this torequire("lspconfig.util").find_git_ancestorby default, which seems like a reasonable default.I guess we might need to update the installation instructions, since we now depend on
lspconfig, or perhaps it would be better just to set a different default (vim.loop.cwd(), but called every time the server is updated, maybe).