Closed verhovsky closed 6 months ago
I wanted to print what Pygments guesses a language would be, but these bindings don't include that function.
ChatGPT hallucinated this
guessed_lexer = Pygments.lexers.guess(code: code)
and I think that makes sense.
You can use Pygments.lexer_names_for for this. See examples: https://github.com/pygments/pygments.rb/blob/v2.4.1/test/test_pygments.rb#L132-L138
Pygments.lexer_names_for
I wanted to print what Pygments guesses a language would be, but these bindings don't include that function.
ChatGPT hallucinated this
and I think that makes sense.