Skip to content

Commit 94f53d1

Browse files
committed
Output written to $stderr when no explicit device provided
Allow puts/p/pp to work without specifying $stderr as the output device. Will fix scenarios where debugging information is accidentally written to $stdout, as well as make puts-style debugging work intuitively. Default output set _after_ OptionParser, since best practice of GNU tools dictates that --help goes to $stdout.
1 parent 9372a1e commit 94f53d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

exe/ruby-lsp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,8 @@ if options[:doctor]
135135
return
136136
end
137137

138+
# Ensure all output goes out stderr by default to allow puts/p/pp to work
139+
# without specifying output device.
140+
$> = $stderr
141+
138142
RubyLsp::Server.new.start

0 commit comments

Comments
 (0)