kylechui / nvim-surround

Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua.
MIT License
2.9k stars 60 forks source link

Mark fields of `user_options` as optional #313

Closed gregorias closed 2 months ago

gregorias commented 3 months ago

Checklist

Neovim Version

0.9.5

Plugin Version

Tagged (Stable)

Minimal Configuration

N/A

Sample Buffer

N/A

Keystroke Sequence

N/A

Expected behavior

Providing just the surrounds field to buffer_setup should type check.

Actual behavior

Providing just the surrounds field to buffer_setup triggers a warning diagnostic from LuaLS.

image

Additional context

The user_options annotations is at https://github.com/kylechui/nvim-surround/blob/84a26afce16cffa7e3322cfa80a42cddf60616eb/lua/nvim-surround/annotations.lua#L56. Could you either mark fields as optional (with a question mark) or change the type annotation of buffer_setup?

kylechui commented 2 months ago

Seems related to #308 ?

gregorias commented 2 months ago

Indeed, it’s a duplicate.

kylechui commented 2 months ago

Do you mind checking out the PR and seeing if the question marks are in the right place?

gregorias commented 2 months ago

I checked it. Looks good.