Skip to content

Commit

Permalink
Address issue 2604
Browse files Browse the repository at this point in the history
  • Loading branch information
theodoretliu committed Sep 23, 2024
1 parent 63b702a commit 3393776
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/ruby_lsp/internal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
require "prism/visitor"
require "language_server-protocol"
require "rbs"
# require "rubocop"

require "ruby-lsp"
require "ruby_lsp/base_server"
Expand Down
16 changes: 16 additions & 0 deletions lib/ruby_lsp/requests/support/rubocop_diagnostic.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# typed: strict
# frozen_string_literal: true

begin
require "rubocop"
rescue LoadError
return
end

begin
gem("rubocop", ">= 1.4.0")
rescue LoadError
raise StandardError, "Incompatible RuboCop version. Ruby LSP requires >= 1.4.0"
end

if RuboCop.const_defined?(:LSP) # This condition will be removed when requiring RuboCop >= 1.61.
RuboCop::LSP.enable
end

module RubyLsp
module Requests
module Support
Expand Down

0 comments on commit 3393776

Please sign in to comment.