zbirenbaum / copilot-cmp

Lua plugin to turn github copilot into a cmp source
MIT License
1.08k stars 39 forks source link

Constant format.lua errors #36

Closed ariel-frischer closed 1 year ago

ariel-frischer commented 1 year ago

I seem to get this when I'm just typing but it comes on and off randomly hard to duplicate.

NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Error executing vim.schedule lua callback: ...e/pack/packer/opt/copilot-cmp/lua/copilot_cmp/format.lua:61: Index out of bounds
stack traceback:
    [C]: in function 'nvim_buf_get_text'
    ...e/pack/packer/opt/copilot-cmp/lua/copilot_cmp/format.lua:61: in function 'get_line_text'
    ...e/pack/packer/opt/copilot-cmp/lua/copilot_cmp/format.lua:76: in function 'format_fn'
    ...e/pack/packer/opt/copilot-cmp/lua/copilot_cmp/format.lua:97: in function 'insert_text'
    ...opt/copilot-cmp/lua/copilot_cmp/completion_functions.lua:7: in function <...opt/copilot-cmp/lua/copilot_cmp/completion_functions.lua:6>
    vim/shared.lua: in function 'tbl_map'
    ...opt/copilot-cmp/lua/copilot_cmp/completion_functions.lua:39: in function 'format_completions'
    ...opt/copilot-cmp/lua/copilot_cmp/completion_functions.lua:61: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>
zbirenbaum commented 1 year ago

I just pushed an update a minute ago. Would you mind syncing and see if it still pops up?

ariel-frischer commented 1 year ago

Sounds good will give update later today.

zbirenbaum commented 1 year ago

Sounds good will give update later today.

Thanks, if it still occurs please include an updated screenshot so I have an easy reference for the line numbers

yngwi commented 1 year ago

Hi, not sure if it's about the same problem, but fmt_info sounds like it is related to formatting. I'm getting this error message:

image

ariel-frischer commented 1 year ago

Haven't gotten that error since updating but I still feel like its a bit too soon to close. Will keep you posted :)

zbirenbaum commented 1 year ago

Haven't gotten that error since updating but I still feel like its a bit too soon to close. Will keep you posted :)

The only outstanding reference to that function was in force_autofmt, which I just removed since it was a hacky solution to problems microsoft introduced prior but have changed in nature.