Replies: 10 comments 13 replies
-
|
you can use blink compact as their is no official blink plugin for r completion for now, you can use this as the basis for starting your own |
Beta Was this translation helpful? Give feedback.
-
|
I have things configured pretty much out of the box, with some tweaks added over time. I'm not using blink.compat, but maybe should be ... Anyway, my lua is here: return {
"saghen/blink.cmp",
opts = {
snippets = {
expand = function(snippet, _)
return LazyVim.cmp.expand(snippet)
end,
},
appearance = {
-- sets the fallback highlight groups to nvim-cmp's highlight groups
-- useful for when your theme doesn't support blink.cmp
-- will be removed in a future release, assuming themes add support
use_nvim_cmp_as_default = false,
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- adjusts spacing to ensure icons are aligned
nerd_font_variant = "mono",
},
completion = {
accept = {
-- experimental auto-brackets support
auto_brackets = {
enabled = true,
},
},
menu = {
draw = {
treesitter = { "lsp" },
},
},
documentation = {
auto_show = true,
auto_show_delay_ms = 200,
},
ghost_text = {
enabled = vim.g.ai_cmp,
},
},
-- experimental signature help support
-- signature = { enabled = true },
sources = {
-- adding any nvim-cmp sources here will enable them
-- with blink.compat
compat = {},
default = { "lsp", "path", "snippets", "buffer", "copilot" },
-- default = { "lsp", "path", "snippets", "buffer" },
providers = {
lsp = {
name = "lsp",
enabled = true,
module = "blink.cmp.sources.lsp",
kind = "LSP",
-- When linking markdown notes, I would get snippets and text in the
-- suggestions, I want those to show only if there are no LSP
-- suggestions
--
-- Enabled fallbacks as this seems to be working now
-- Disabling fallbacks as my snippets wouldn't show up when editing
-- lua files
-- fallbacks = { "snippets", "buffer" },
score_offset = 100, -- the higher the number, the higher the priority
},
path = {
name = "Path",
module = "blink.cmp.sources.path",
score_offset = 50,
-- When typing a path, I would get snippets and text in the
-- suggestions, I want those to show only if there are no path
-- suggestions
fallbacks = { "snippets", "buffer" },
opts = {
trailing_slash = false,
label_trailing_slash = true,
get_cwd = function(context)
return vim.fn.expand(("#%d:p:h"):format(context.bufnr))
end,
show_hidden_files_by_default = true,
},
},
buffer = {
name = "Buffer",
enabled = true,
max_items = 3,
module = "blink.cmp.sources.buffer",
min_keyword_length = 4,
score_offset = 25, -- the higher the number, the higher the priority
},
copilot = {
name = "copilot",
enabled = true,
module = "blink-cmp-copilot",
kind = "Copilot",
min_keyword_length = 3,
score_offset = 25, -- the higher the number, the higher the priority
async = true,
},
},
-- cmdline = {},
},
keymap = {
preset = "default",
["<Tab>"] = { "select_and_accept" },
},
},
} |
Beta Was this translation helpful? Give feedback.
-
|
I added a warning that it's deprecated and disabled it when the module "r.lsp" exists. Can you update |
Beta Was this translation helpful? Give feedback.
-
|
@PMassicotte, I think it's time to archive the |
Beta Was this translation helpful? Give feedback.
-
|
It's archived now. |
Beta Was this translation helpful? Give feedback.
-
|
Hi! I am having some trouble configuring the completion with r_ls... As far as I have seen, r_ls does not provide diagnostics, right? That's why I am still using r_language_server for diagnostics, but I would like to get the completions from r_ls. If I enable both I get autocompletions from both lsps, so that each entry in the menu is duplicated. In addition, I have found that r_ls crashes when hovering/providing argument autocompletion for functions with a huge number of parameters (r_language_server works fine with those). And I get: Unfortunatelly, lsp.log does not contain further information appart from: I am experiencing that with the ectotherm function of NicheMapR: devtools::install_github("mrke/NicheMapR")
library(NicheMapR)
ectotherm(And right there I get the "client r_ls quit with ....." message. Any advice on how to properly configure this would be greatly appreciated. Sorry for the super long message and thanks for this awesome plugin! |
Beta Was this translation helpful? Give feedback.
-
You can put this in your # Disable completion from the language server
options(
languageserver.server_capabilities = list(
hoverProvider = FALSE,
signatureHelpProvider = FALSE,
completionProvider = FALSE,
completionItemResolve = FALSE
)
)I'll look at the crash... thanks for reporting the bug! |
Beta Was this translation helpful? Give feedback.
-
|
I tried to install "NicheMapR", but got this error: Is there another function that makes |
Beta Was this translation helpful? Give feedback.
-
|
I can replicate the bug. I added the ectotherm function nvimcom with an empty body and now I get the crash. |
Beta Was this translation helpful? Give feedback.
-
|
@urtzienriquez, can you try the branch "fix_bugs"? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey - many thanks for this plugin.
Does it work with blink.cmp? How would one use this
cmp.rpackage in this case? Many thanks.Beta Was this translation helpful? Give feedback.
All reactions