Open danielkaxis opened 2 days ago
Any chance you can use the playground?
Any chance you can use the playground?
Here is a playground. Doesn't show any Biome output since it encounters this error:
Biome encountered an unexpected error
This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:
Source Location: crates/biome_graphql_formatter/src/graphql/value/string_value.rs:45:51
Thread Name: biome::worker_5
Message: byte index 2 is out of bounds of ``
Awesome, thank you. It seems there's a parsing error
cc @vohoanglong0107
I think I've found out the cause. In this line
It's trying to remove the indentation from the comment by the minimum indent level of the entire block comment.
But at the same time, in this line
The formatter explicitly ignores empty lines, so min_indent does not factor in empty lines in its calculation. So when the formatter encounters an empty line, it still tries to extract min_indent from that line, which causes it to panic.
I will push a fix for this sometime tomorrow.
Environment information
Configuration
Playground link
https://github.com/danielkaxis/biome-graphql-issue
Code of Conduct