diff --git a/lib/ruby_lsp/server.rb b/lib/ruby_lsp/server.rb index 83eaf2a05..d0c24451b 100644 --- a/lib/ruby_lsp/server.rb +++ b/lib/ruby_lsp/server.rb @@ -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