hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.53k stars 377 forks source link

Mark non-required setup fields as optional #1723

Closed komidore64 closed 7 months ago

komidore64 commented 9 months ago

I have been getting "Missing required fields" messages from lua-language-server (> 3.6.23) for table values handed to require('cmp').setup().

missing-required-fields-diagnostics

This is a naive attempt to fix those missing required fields messages. I'm still fairly new to Lua, but happy to learn!

Please let me know if I've missed any others that are optional so I can get those marked too.

Once applying this patch to a local checkout of nvim-cmp, I don't get missing field diagnostic messages anymore.

no-diagnostics

Thanks for considering my patch!

lttb commented 8 months ago

I have the same issue, it'd be great to see it merged! thank you

tjdevries commented 7 months ago

@hrsh7th this does seem like a pretty good change IMO, not sure if there is a more elegant way to solve this but it's nice to note that the user does not HAVE to provide each of the fields

This would be something interesting to think about as an ecosystem if there is an easier way to mark all fields as optional or something

hrsh7th commented 7 months ago

Thank you!