From 46081444b0fca85756a6601ed1289695aa94d2f6 Mon Sep 17 00:00:00 2001 From: EraPartner Date: Sat, 14 Dec 2024 13:49:29 +0100 Subject: [PATCH 1/2] feat(r): add blink support for cmp-r --- lua/lazyvim/plugins/extras/lang/r.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index 6320f624..d4ee7534 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -47,6 +47,22 @@ return { require("r.pdf.generic").open = vim.ui.open end, }, + { + "saghen/blink.cmp", + optional = true, + dependencies = { + "R-nvim/cmp-r", + }, + opts = function(_, opts) + table.insert(opts.sources.compat or {}, "cmp_r") + + opts.sources.providers["cmp-r"] = vim.tbl_deep_extend( + "force", + opts.sources.providers["cmp-r"] or {}, + { name = "cmp_r", module = "blink.compat.source" } + ) + end, + }, { "hrsh7th/nvim-cmp", optional = true, From a3924f7f46415d8d300dcbe52c8d7bc6e2a43cb1 Mon Sep 17 00:00:00 2001 From: EraPartner Date: Sat, 14 Dec 2024 15:41:04 +0100 Subject: [PATCH 2/2] Specify option instead of a function --- lua/lazyvim/plugins/extras/lang/r.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index d4ee7534..df112b4d 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -53,15 +53,13 @@ return { dependencies = { "R-nvim/cmp-r", }, - opts = function(_, opts) - table.insert(opts.sources.compat or {}, "cmp_r") - - opts.sources.providers["cmp-r"] = vim.tbl_deep_extend( - "force", - opts.sources.providers["cmp-r"] or {}, - { name = "cmp_r", module = "blink.compat.source" } - ) - end, + opts = { + sources = { + compat = { + cmp_r = { name = "cmp_r", module = "blink.compat.source" }, + }, + }, + }, }, { "hrsh7th/nvim-cmp",