R-nvim / R.nvim

Neovim plugin to edit R files
GNU General Public License v3.0
132 stars 15 forks source link

Replacement for cmp-nvim-r #11

Closed jalvesaq closed 4 months ago

jalvesaq commented 5 months ago

R-Nvim will rely on cmp-r for auto-completion, but we can use the branch rnvim of `cmp-nvim-r' while we don't create the R-Nvim organization.

PMassicotte commented 4 months ago

Is autocomplete working at this time? I am thinking to slowly transition to tmp-R-Nvim to test more in depth.

My config at the moment:

return {
    'jalvesaq/cmp-nvim-r',
    branch = 'rnvim',
    config = function()
        require('cmp_r').setup {
            filetypes = { 'r', 'rmd', 'quarto' },
            doc_width = 150,
        }
    end,
}
jalvesaq commented 4 months ago

Yes, it's working almost since the beginning because it's already written in Lua.

PMassicotte commented 4 months ago

ok cool, one thing I forgot was that (was FALSE):

  languageserver.server_capabilities =
    list(
      completionProvider = TRUE,
      completionItemResolve = TRUE
    ),

Now I am getting that on key press (so looks like cmp is trying to do something at least)

image

I will dig that out.

jalvesaq commented 4 months ago

You have to replace "cmp_nvim_r" with "cmp_r" in the cmp config.

PMassicotte commented 4 months ago

This is what I have in my nvim-cmp.lua config:

            sources = {
                { name = 'nvim_lsp', keyword_length = 1 },
                { name = 'cmp_r', keyword_length = 1 },
                -- { name = 'nvim_lsp_signature_help' },
                { name = 'languageserver' },
                { name = 'luasnip' },
                { name = 'cmp_zotcite' },
                { name = 'omni' },
                { name = 'cssls' },
                { name = 'dockerls' },
                { name = 'json_lsp' },
                { name = 'marksman' },
                { name = 'crates' },
                { name = 'otter' },
                -- { name = 'path' },
                -- { name = 'Buffer' },
                {
                    name = 'path',
                    option = {
                        trailing_slash = true,
                        get_cwd = function(_)
                            return vim.fn.getcwd()
                        end,
                    },
                },
                { name = 'buffer' },
            },
PMassicotte commented 4 months ago

I also have this issue with Rust, so not about nvimr. So it is on my side.

jalvesaq commented 4 months ago

https://github.com/R-nvim/cmp-r