Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
SyntaxSuggest#detailed_message
detailed_message(highlight: true, syntax_suggest: true, **kwargs)
lib/syntax_suggest/core_ext.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/syntax_suggest/core_ext.rb, line 7
def detailed_message(highlight: true, syntax_suggest: true, **kwargs)
return super unless syntax_suggest
require "syntax_suggest/api" unless defined?(SyntaxSuggest::DEFAULT_VALUE)
message = super
if path
file = Pathname.new(path)
io = SyntaxSuggest::MiniStringIO.new
SyntaxSuggest.call(
io: io,
source: file.read,
filename: file,
terminal: highlight
)
annotation = io.string
annotation += "\n" unless annotation.end_with?("\n")
annotation + message
else
message
end
rescue => e
if ENV["SYNTAX_SUGGEST_DEBUG"]
warn(e.message)
warn(e.backtrace)
end
# Ignore internal errors
message
end
No documentation available