[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)
|
require "syntax_suggest/api" unless defined?(SyntaxSuggest::DEFAULT_VALUE)
|
||||||
|
|
||||||
message = super
|
message = super
|
||||||
file = if highlight
|
file = path
|
||||||
SyntaxSuggest::PathnameFromMessage.new(super(highlight: false, **kwargs)).call.name
|
|
||||||
else
|
|
||||||
SyntaxSuggest::PathnameFromMessage.new(message).call.name
|
|
||||||
end
|
|
||||||
|
|
||||||
io = SyntaxSuggest::MiniStringIO.new
|
|
||||||
|
|
||||||
if file
|
if file
|
||||||
|
file = Pathname.new(file)
|
||||||
|
io = SyntaxSuggest::MiniStringIO.new
|
||||||
|
|
||||||
SyntaxSuggest.call(
|
SyntaxSuggest.call(
|
||||||
io: io,
|
io: io,
|
||||||
source: file.read,
|
source: file.read,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user