redhat-developer / redhat-developer/lsp4ij

Markdown code block syntax highlighting issues in Quick Documentation

Open
#557 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
344
Forks
113
Avg merge
5h 22m
Merged PRs (30d)
15

Description

Discussed in https://github.com/redhat-developer/lsp4ij/discussions/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>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the Quick Documentation rendering path for the Markdown in a textDocument/hover response; the issue provides the hover payload and screenshots but no source files or tests. Reproduce the Rust code-block case and compare it with editor highlighting; done when // comments are rendered consistently in Quick Documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, markdown
Domain
developer-experience, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.