Skip to content

Commit

Permalink
Use the config-dependent documentation_url call from rubocop 1.64.0
Browse files Browse the repository at this point in the history
  • Loading branch information
searls committed Jun 23, 2024
1 parent cfa47ac commit b0994af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ruby_lsp/standard/wraps_built_in_lsp_standardizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def init!
@config,
::Standard::Lsp::Logger.new
)
@rubocop_config = @config.rubocop_config_store.for_pwd
@cop_registry = RuboCop::Cop::Registry.global.to_h
end

Expand Down Expand Up @@ -73,7 +74,7 @@ def uri_to_path(uri)
# https://github.com/Shopify/ruby-lsp/blob/4c1906172add4d5c39c35d3396aa29c768bfb898/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb#L84
def code_description(cop_name)
if (cop_class = @cop_registry[cop_name]&.first)
if (doc_url = cop_class.documentation_url)
if (doc_url = cop_class.documentation_url(@rubocop_config))
Interface::CodeDescription.new(href: doc_url)
end
end
Expand Down

0 comments on commit b0994af

Please sign in to comment.