copilot.lua icon indicating copy to clipboard operation
copilot.lua copied to clipboard

Multiple offset encodings warning when used with clangd

Open herrglocke opened this issue 2 years ago • 5 comments

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.

herrglocke avatar Dec 07 '23 11:12 herrglocke

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.

MunifTanjim avatar Dec 07 '23 16:12 MunifTanjim

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

herrglocke avatar Dec 10 '23 13:12 herrglocke

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!

JunkLeo avatar Dec 16 '23 05:12 JunkLeo

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.

asharkhan3101 avatar Dec 18 '23 09:12 asharkhan3101

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?

weeebdev avatar May 11 '24 17:05 weeebdev