Feel-ix-343 / markdown-oxide

PKM for the LSP
https://oxide.md
Apache License 2.0
1.03k stars 17 forks source link

Neovim capabilities.workspace.didChangeWatchedFiles recommendation is doubtful #152

Closed powerman closed 3 months ago

powerman commented 4 months ago

In https://oxide.md/v0/Guides/Getting+started+with+Markdown+Oxide+Version+0#Neovim you insist on enabling capabilities.workspace.didChangeWatchedFiles.dynamicRegistration but it is disabled on some OSes for a reason (check issues mentioned on this line): https://github.com/neovim/neovim/blob/2a24d0a4357d24d6edbd454ab2465abf460467db/runtime/lua/vim/lsp/protocol.lua#L536

Maybe it makes sense to remove this recommendation and just wait until Neovim will resolve these issues and re-enable this capability?

Feel-ix-343 commented 4 months ago

Hey! Thank you for the contribution!

This is an interesting one. The file watcher is currently required for a few features I use frequently, so for me, I see a few options.

I have picked the latter and it has works fine for me. note that it is very slow, but other than that, it works.

Considering these options now, I think 2 is certainly the best.

TODO:

powerman commented 4 months ago

Maybe one more option is to ensure this option will be enabled just for this one LSP, e.g. change docs to something like this:

require('lspconfig').markdown_oxide.setup {
    capabilities = vim.tbl_deep_extend(
        'force',
        capabilities,
        {
            workspace = {
                didChangeWatchedFiles = {
                    dynamicRegistration = true,
                },
            },
        }
    ),
}

Because in a way it's shown in the doc now it looks like very usual lspconfig setup, but in that usual setup we prepare capabilities once and then use them for all LSP, so there is a high chance users will copy&paste it from the doc and occasionally apply to all their LSP.

Feel-ix-343 commented 4 months ago

Yes this is best.

Are you at all interested in making this change?

The docs are in the docs folder

powerman commented 4 months ago

Not really. English is not my native language and I usually write docs in a different style, so I'll leave this for you. :smile:

Feel-ix-343 commented 4 months ago

All good!