Skip to content

Commit

Permalink
Print to the output tab instead of showing a dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrocha committed Oct 2, 2024
1 parent c4f78a7 commit cd07fc7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/ruby_lsp/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
)
Expand Down

0 comments on commit cd07fc7

Please sign in to comment.