Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown code block syntax highlighting issues in Quick Documentation #557

Open
angelozerr opened this issue Oct 1, 2024 Discussed in #492 · 0 comments
Open

Markdown code block syntax highlighting issues in Quick Documentation #557

angelozerr opened this issue Oct 1, 2024 Discussed in #492 · 0 comments
Labels
bug Something isn't working

Comments

@angelozerr
Copy link
Contributor

Discussed in #492

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.

Screenshot

// Implements notable traits: Future<Output = ?>
pub fn with_graceful_shutdown<F>(self, signal: F) -> Graceful<I, S, F, E>
where
    F: Future<Output = ()>,
    E: NewSvcExec<IO, S::Future, S::Service, E, GracefulWatcher>,
// 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 angelozerr added the bug Something isn't working label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant