zbirenbaum / copilot.lua

Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot
MIT License
2.43k stars 64 forks source link

Multiple offset encodings warning when used with clangd #247

Open herrglocke opened 7 months ago

herrglocke commented 7 months ago

In C++ files when clangd is attached and copilot.lua is loaded, a repeated warning about Multiple offset encodings occurs. This seems to be a common issue as well when using null-ls at the same time as clangd but the fixes used for that do not seem to work with copilot.lua.

MunifTanjim commented 7 months ago

Can you provide more details about how to reproduce it? I don't use clangd for my day job, and unless you give me exact steps to reproduce the issue I can't help.

herrglocke commented 6 months ago

To reproduce, load copilot.lua and let clangd attach itself to a buffer. The below warning then repeatedly pops up for any cursor change or edit whether inside Insert mode or outside. When I do :Copilot disable, this stops occurring.

image

JunkLeo commented 6 months ago

To reproduce, load copilot.lua and let clangd attach itself to a buffer. The below warning then repeatedly pops up for any cursor change or edit whether inside Insert mode or outside. When I do :Copilot disable, this stops occurring.

image

Got the same warning!

asharkhan3101 commented 6 months ago

This isn't an copilot.lua issue.

https://github.com/jose-elias-alvarez/null-ls.nvim/issues/428

The problem ariese because two clients copilot and clangd using different offset_encoding attached to same buffer, solution proposed in the thread is to either change clangd's or in this case copilot offset encoding. By default, clangd uses utf-32 offset encoding.

weeebdev commented 1 month ago

This isn't an copilot.lua issue.

jose-elias-alvarez/null-ls.nvim#428

The problem ariese because two clients copilot and clangd using different offset_encoding attached to same buffer, solution proposed in the thread is to either change clangd's or in this case copilot offset encoding. By default, clangd uses utf-32 offset encoding.

by any chance, do you know how to change the offset for copilot?