mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-17 13:58:44 +00:00
Attach doc-comment to declaration if there are newlines in between
This commit changes the parser to attach doc-comments to the corresponding declaration in case there are newlines in between the doc-comment and the declaration.
This commit is contained in:
parent
668980d865
commit
77f89a700b
3 changed files with 32 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
|||
/// Example
|
||||
|
||||
fn test() {}
|
|
@ -0,0 +1,17 @@
|
|||
SOURCE_FILE@[0; 26)
|
||||
FN_DEF@[0; 25)
|
||||
COMMENT@[0; 11) "/// Example"
|
||||
WHITESPACE@[11; 13) "\n\n"
|
||||
FN_KW@[13; 15) "fn"
|
||||
WHITESPACE@[15; 16) " "
|
||||
NAME@[16; 20)
|
||||
IDENT@[16; 20) "test"
|
||||
PARAM_LIST@[20; 22)
|
||||
L_PAREN@[20; 21) "("
|
||||
R_PAREN@[21; 22) ")"
|
||||
WHITESPACE@[22; 23) " "
|
||||
BLOCK_EXPR@[23; 25)
|
||||
BLOCK@[23; 25)
|
||||
L_CURLY@[23; 24) "{"
|
||||
R_CURLY@[24; 25) "}"
|
||||
WHITESPACE@[25; 26) "\n"
|
Loading…
Add table
Add a link
Reference in a new issue