Open
Description
I was not passing some MRI pattern matching specs and realized that it was not setting the NullFormatter. It is because formatter requires Ractors to work.
I did a quick fix:
# Returns the currently set formatter. By default, it is set to +DidYouMean::Formatter+.
def self.formatter
storage = defined?(Ractor) ? Ractor : Thread
storage.current[:__did_you_mean_formatter__] || Formatter
end
# Updates the primary formatter used to format the suggestions.
def self.formatter=(formatter)
storage = defined?(Ractor) ? Ractor : Thread
storage.current[:__did_you_mean_formatter__] = formatter
end
but I suspect this is not right. This is a global setting and not just a thread-specific one...or is it?
Metadata
Metadata
Assignees
Labels
No labels