vlang / v-analyzer

The @vlang language server, for all your editing needs like go-to-definition, code completion, type hints, and more.
MIT License
92 stars 10 forks source link

Struct field doc comments use inline comments of above fields #49

Closed ttytm closed 5 months ago

ttytm commented 5 months ago

Describe the bug

An issue @bramvbilsen run into: https://github.com/vlang/v/pull/21023#issue-2186879711. Thanks again for the report.

Screenshot_20240322_073830

Expected Behavior

Doc comments correctly use inline comments.

Current Behavior

Inline comments of struct field above are used / No doc comment if it's the first field with an end of line comment.

Reproduction Steps

module main

pub struct Foo {
    a string // a comment
    b string // b comment
}

fn main() {
    foo := Foo{}
    foo.b // <- open the struct fields hover dialog.
}

Possible Solution

No response

Additional Information/Context

No response

Environment details (v doctor output)

-

Editor name

neovim, code

v-analyzer Version

0.4.1.beta.1

VS Code Extension Version

No response