We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm getting completion results with missing lines from documentation code blocks.
rust-analyzer version: rust-analyzer version: 0.3.2086-standalone (7106cd3be 2024-08-25)
rust-analyzer version: 0.3.2086-standalone (7106cd3be 2024-08-25)
rustc version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)
rustc 1.80.1 (3f5fd8dd4 2024-08-06)
editor or extension: Manually LSP server requests but same behavior with VS Code Version: 1.92.2.
1.92.2
code snippet to reproduce:
fn main() { // Place cursor at the end of ...by and the completion suggestion will include incorrect documentation. u16::from_le_by }
The generated documentation has the full snippets. Also, the same as the official docs
let value = u16::from_le_bytes([0x34, 0x12]); assert_eq!(value, 0x1234);
and
fn read_le_u16(input: &mut &[u8]) -> u16 { let (int_bytes, rest) = input.split_at(std::mem::size_of::<u16>()); *input = rest; u16::from_le_bytes(int_bytes.try_into().unwrap()) }
Whereas rust-analyzer generates the first block as empty code and the second one with two lines with the rest missing.
rust-analyzer
Here's the LSP server completion response JSON.
{ "label": "from_le_bytes", "kind": 3, "detail": "const fn([u8; {in type const InTypeConstId(36)}]) -> u16", "documentation": { "kind": "markdown", "value": "Create a native endian integer value from its representation\nas a byte array in little endian.\n\n\n\n# Examples\n\n```rust\n```\n\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:\n\n```rust\n *input = rest;\n}\n```" }, "deprecated": false, "sortText": "ffffffe0", "filterText": "from_le_bytes", "textEdit": { "range": { "start": { "line": 22, "character": 9 }, "end": { "line": 22, "character": 18 } }, "newText": "from_le_bytes" }, "additionalTextEdits": [] },
The text was updated successfully, but these errors were encountered:
This is known, the cause is that r-a can't yet expand macros in inert attributes (closing it as t here are bunch of issues regarding this already)
Sorry, something went wrong.
Thanks! Perhaps you could link to the other issues that refer to this issue? I looked but couldn't find them. @Veykril
#8092, #11137
No branches or pull requests
I'm getting completion results with missing lines from documentation code blocks.
rust-analyzer version:
rust-analyzer version: 0.3.2086-standalone (7106cd3be 2024-08-25)
rustc version:
rustc 1.80.1 (3f5fd8dd4 2024-08-06)
editor or extension: Manually LSP server requests but same behavior with VS Code Version:
1.92.2
.code snippet to reproduce:
The generated documentation has the full snippets. Also, the same as the official docs
and
Whereas
rust-analyzer
generates the first block as empty code and the second one with two lines with the rest missing.Here's the LSP server completion response JSON.
The text was updated successfully, but these errors were encountered: