zbirenbaum / copilot-cmp

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

Is format.remove_existing ever coming back? #40

Closed DanielVolchek closed 1 year ago

DanielVolchek commented 1 year ago

I am having trouble with autotags leaving extra end parens and brackets when using cmp completion. Seems like remove_existing was designed to solve that problem but it is currently disabled in format.lua. Can we expect to see this return or is it fully deprecated? If so I would recommend removing it from the readme file.

Do you know of an alternate method to solve this issue?

garrett361 commented 1 year ago

I would also find this super useful!

zbirenbaum commented 1 year ago

If you set up your cmp config correctly though, remove_existing should be entirely redundant. Something like this should work:

    ["<CR>"] = cmp.mapping.confirm({
      behavior = cmp.ConfirmBehavior.Replace,
      select = false,
    }),

I thought I removed format.remove_existing but I just checked and it's still there. Are you sure you aren't thinking of force_autofmt? force_autofmt was always meant to be a temporary solution to an upstream problem and won't be coming back unless absolutely necessary. The snippet in the readme for setting remove_existing as a formatter should be working I think.

zbirenbaum commented 1 year ago

With the PR currently awaiting merge no extra formatting should be necessary. Can you confirm it fixes your issues?

zbirenbaum commented 1 year ago

67