diff --git a/lib/ruby_lsp/standard/wraps_built_in_lsp_standardizer.rb b/lib/ruby_lsp/standard/wraps_built_in_lsp_standardizer.rb index 767bb2ac..ddcf60e4 100644 --- a/lib/ruby_lsp/standard/wraps_built_in_lsp_standardizer.rb +++ b/lib/ruby_lsp/standard/wraps_built_in_lsp_standardizer.rb @@ -66,8 +66,13 @@ def run_diagnostic(uri, document) private # duplicated from: lib/standard/lsp/routes.rb + # modified to incorporate Ruby LSP's to_standardized_path method def uri_to_path(uri) - uri.to_s.sub(%r{^file://}, "") + if uri.respond_to?(:to_standardized_path) && !(standardized_path = uri.to_standardized_path).nil? + standardized_path + else + uri.to_s.sub(%r{^file://}, "") + end end # lifted from: