You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Markdown code block syntax highlighting issues in Quick Documentation #557
Originally posted by harry-xm August 28, 2024 // is not grayed out in the following parts of a textDocument/hover result, but is grayed out in the editor.
// Make a server from the previous examples...let server = Server::bind(&([127,0,0,1],3000).into()).serve(make_service);
...
LSP server's response is
[Trace - 20:07:31] Received response 'textDocument/hover - (89)' in 1ms.
Result: {
"contents": {
"kind": "markdown",
"value": "\n```rust\nhyper::server::server::Server\n```\n\n```rust\n// Implements notable traits: Future\u003cOutput \u003d ?\u003e\npub fn with_graceful_shutdown\u003cF\u003e(self, signal: F) -\u003e Graceful\u003cI, S, F, E\u003e\nwhere\n F: Future\u003cOutput \u003d ()\u003e,\n E: NewSvcExec\u003cIO, S::Future, S::Service, E, GracefulWatcher\u003e,\n```\n\n---\n\nPrepares a server to handle graceful shutdown when the provided future\ncompletes.\n\n# Example\n\n```rust\n// Make a server from the previous examples...\nlet server \u003d Server::bind(\u0026([127, 0, 0, 1], 3000).into())\n .serve(make_service);\n\n// Prepare some signal for when the server should start shutting down...\nlet (tx, rx) \u003d tokio::sync::oneshot::channel::\u003c()\u003e();\nlet graceful \u003d server\n .with_graceful_shutdown(async {\n rx.await.ok();\n });\n\n// Await the `server` receiving the signal...\nif let Err(e) \u003d graceful.await {\n eprintln!(\"server error: {}\", e);\n}\n\n// And later, trigger the signal by calling `tx.send(())`.\nlet _ \u003d tx.send(());\n```"
},
"range": {
"start": {
"line": 96,
"character": 9
},
"end": {
"line": 96,
"character": 31
}
}
}
```</div>
@angelozerr does this still happen with 0.30.1? Code blocks in Quick Documentation are colored by the lexer of their language (LightQuickDocHighlightingHelper), so the gray // in the editor likely comes from semantic tokens. Which plugin provides the rust language in your setup?
The case of this issue works: in the documentation of a Rust file, the // comments of a ```rust code block are gray, as in the editor.
fix: color a code block of the documentation by the TextMate grammar of its own language #2086 fixed the rest: a code block whose language IntelliJ doesn't have is now colored by the TextMate grammar of its own language, not by that of the file. Before, a ```python block in the documentation of a Rust file was colored by the Rust grammar, and a ```rust block in that of a text file wasn't colored.
Please reopen if it still happens with 0.30.2, with the plugin that gives the language of the code block in your setup.
Activity
lagergren commentedon Nov 20, 2026
@angelozerr does this still happen with 0.30.1? Code blocks in Quick Documentation are colored by the lexer of their language (
LightQuickDocHighlightingHelper), so the gray//in the editor likely comes from semantic tokens. Which plugin provides therustlanguage in your setup?fix: color a code block of the documentation by the TextMate grammar …
lagergren commentedon Nov 22, 2026
Closing, as this is fixed on
mainfor 0.30.2://comments of a```rustcode block are gray, as in the editor.```pythonblock in the documentation of a Rust file was colored by the Rust grammar, and a```rustblock in that of a text file wasn't colored.Please reopen if it still happens with 0.30.2, with the plugin that gives the language of the code block in your setup.