From b3926d8987690ea998c768caac3404454912e24f Mon Sep 17 00:00:00 2001 From: kik4444 <7779637+kik4444@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:10:01 +0300 Subject: [PATCH] Do not enable Rubocop as LSP if Solargraph is used Solargraph already delegates some diagnostics to Rubocop by itself if it is installed on your system. However, if Rubocop is also enabled as an LSP while you're using Solargraph, then all Rubocop diagnostics are going to be duplicated and shown twice. Once from Solargraph after it calls Rubocop, and again by Rubocop separately running as an LSP. --- lua/lazyvim/plugins/extras/lang/ruby.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/ruby.lua b/lua/lazyvim/plugins/extras/lang/ruby.lua index 6eb4fce5..f76718a9 100644 --- a/lua/lazyvim/plugins/extras/lang/ruby.lua +++ b/lua/lazyvim/plugins/extras/lang/ruby.lua @@ -36,7 +36,10 @@ return { enabled = lsp == "solargraph", }, rubocop = { - enabled = formatter == "rubocop", + -- If Solargraph and Rubocop are both enabled as an LSP, + -- diagnostics will be duplicated because Solargraph + -- already calls Rubocop if it is installed + enabled = formatter == "rubocop" and lsp ~= "solargraph", }, standardrb = { enabled = formatter == "standardrb",