x/tools/gopls: render code blocks in hover differently if they are not used for Go code #47286
For asking questions, see:
Before filing an issue, please review our troubleshooting guides
Please answer these questions before submitting your issue. Thanks!
What version of Go, VS Code & VS Code Go extension are you using?
Share the Go related settings you have added/edited
Describe the bug
A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.
A consistent style for function linting display.
Steps to reproduce the behavior:
Screenshots or recordings
The text was updated successfully, but these errors were encountered:
Hah, we can get the correct behavior by formatting our pre-block like this, i.e. chosing a non-existent syntax:
It's unclear to me what's correct here. https://blog.golang.org/godoc says simply that indented blocks should be pre-formatted (meaning no syntax highlighting). Markdown says fenced (or indented) blocks are 'code blocks', with varying implementations.
We could use embedded html
I am not sure about all the scaping logic here. What will happen if the
As @findleyr analyzed, the root cause is that vscode assumes the code blocks in hover are go code, which is untrue in this specific case. We think the code blocks are used often to show how to use the APIs and present code examples, so we decided not to add a workaround for vscode yet.
If this becomes common issues, we can consider using workarounds like
I am transferring to the gopls issue tracker.