Closed joscani closed 1 year ago
Autocompletion with cmp-nvim-r completes:
$
data.frame
is piped to the functionand when a column name is selected, Nvim-R runs either summary()
or str()
and displays the result in the menu's float window. So, I'm sorry, but I didn't understand what kind of autocompletion you are missing.
Perhaps you have the language server package installed and has enabled it... So, I added this to the README:
Since cmp-nvim-r
and the R package languageserver
provide completions for the same code, and completions from the languageserver
might be the first ones to be displayed by nvim-cmp
, you may want to put this in your ~/.Rprofile
:
# Disable completion from the language server
options(languageserver.server_capabilities =
list(completionProvider = FALSE, completionItemResolve = FALSE))
You're right, But it's not necessary edit Rprofile, you can simply no configure r-language-server in lspconfig. I comment lspsconfig line
My config
require'cmp'.setup {
sources = {
{ name = 'cmp_nvim_r' },
}
}
--require'lspconfig'.r_language_server.setup{}
I like to see the diagnostics for R code from languageserver
, and I use language server completions for Python, Lua, VimLanguage, C and C++. That's why I still set up the r_language_server
and include nvim_lsp
as a cmp
source. But your solution is better for people programming in R only and who find R's languageserver
diagnostics more distracting than helpful.
In old ncm-R plugin I saw how autocompletion works after $ signs and after pipe , even autocompletion looks inside dataframe and works after tidyverse verbs like filter and suggest column names.
I'm newbie using neovim , and finally I configure nvim-cmp and cmp-nvim-r and they are fantastic, but I would like this kind of autocompletion.
Thanks in advance