[ruby/syntax_suggest] No longer need PathnameFromMessage with SyntaxError#path.
https://bugs.ruby-lang.org/issues/19138 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> https://github.com/ruby/syntax_suggest/commit/8e1e7b3298
This commit is contained in:
parent
def258e775
commit
652e2d8f5d
@ -25,15 +25,12 @@ if SyntaxError.method_defined?(:detailed_message)
|
||||
require "syntax_suggest/api" unless defined?(SyntaxSuggest::DEFAULT_VALUE)
|
||||
|
||||
message = super
|
||||
file = if highlight
|
||||
SyntaxSuggest::PathnameFromMessage.new(super(highlight: false, **kwargs)).call.name
|
||||
else
|
||||
SyntaxSuggest::PathnameFromMessage.new(message).call.name
|
||||
end
|
||||
|
||||
io = SyntaxSuggest::MiniStringIO.new
|
||||
file = path
|
||||
|
||||
if file
|
||||
file = Pathname.new(file)
|
||||
io = SyntaxSuggest::MiniStringIO.new
|
||||
|
||||
SyntaxSuggest.call(
|
||||
io: io,
|
||||
source: file.read,
|
||||
|
Loading…
x
Reference in New Issue
Block a user