Skip to content

Commit 27c6af7

Browse files
authored
Log when trying to format files outside of workspace (#2853)
1 parent e6a3703 commit 27c6af7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/ruby_lsp/server.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,11 @@ def text_document_formatting(message)
604604
# don't want to format it
605605
path = uri.to_standardized_path
606606
unless path.nil? || path.start_with?(@global_state.workspace_path)
607+
send_log_message(<<~MESSAGE)
608+
Ignoring formatting request for file outside of the workspace.
609+
Workspace path was set by editor as #{@global_state.workspace_path}.
610+
File path requested for formatting was #{path}
611+
MESSAGE
607612
send_empty_response(message[:id])
608613
return
609614
end

0 commit comments

Comments
 (0)