From cd07fc72bbffebf827d1e4e45a63bc32997ae1a2 Mon Sep 17 00:00:00 2001 From: Alex Rocha Date: Mon, 30 Sep 2024 16:52:05 -0700 Subject: [PATCH] Print to the output tab instead of showing a dialog --- lib/ruby_lsp/server.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ruby_lsp/server.rb b/lib/ruby_lsp/server.rb index 0e46f6671..ff3cd16bc 100644 --- a/lib/ruby_lsp/server.rb +++ b/lib/ruby_lsp/server.rb @@ -321,13 +321,17 @@ def text_document_did_open(message) ) if document.past_expensive_limit? + log_message = <<~MESSAGE + The file #{text_document[:uri].path} is too long. For performance reasons, semantic highlighting and + diagnostics will be disabled. + MESSAGE + send_message( Notification.new( - method: "window/showMessage", - params: Interface::ShowMessageParams.new( + method: "window/logMessage", + params: Interface::LogMessageParams.new( type: Constant::MessageType::WARNING, - message: "This file is too long. For performance reasons, semantic highlighting and " \ - "diagnostics will be disabled", + message: log_message, ), ), )