Skip to content

Commit

Permalink
fix formatting condition
Browse files Browse the repository at this point in the history
the condition did not take special characters in Dir.pwd into account. Use the same condition as used in RubyLsp::Requests::Diagnostics
  • Loading branch information
tonklon committed Jun 23, 2023
1 parent 1ed9d81 commit 056ca8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ruby_lsp/requests/formatting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def run
return if @formatter == "none"

# Don't try to format files outside the current working directory
return unless @uri.sub("file://", "").start_with?(Dir.pwd)
return unless URI(@uri).path&.start_with?(T.must(WORKSPACE_URI.path))

return if @document.syntax_error?

Expand Down

0 comments on commit 056ca8a

Please sign in to comment.