The code can be collapsed, and only beggining part of the query is shown in this case. But when there exists a comment before a statement the collapsing treates it as a query beginning. So the query itself is completely hidden.
Updating CodeMirror to the latest version has fixed this issue.
I [raised it](https://github.com/codemirror/dev/issues/1008) on the CodeMirror issue tracker and the maintainer pointed out it was working fine in their sandbox - next time I will try that first!