Skip to content

Commit

Permalink
Log when trying to format files outside of workspace (#2853)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Nov 14, 2024
1 parent e6a3703 commit 27c6af7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ruby_lsp/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,11 @@ def text_document_formatting(message)
# don't want to format it
path = uri.to_standardized_path
unless path.nil? || path.start_with?(@global_state.workspace_path)
send_log_message(<<~MESSAGE)
Ignoring formatting request for file outside of the workspace.
Workspace path was set by editor as #{@global_state.workspace_path}.
File path requested for formatting was #{path}
MESSAGE
send_empty_response(message[:id])
return
end
Expand Down

0 comments on commit 27c6af7

Please sign in to comment.