You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Syntax Error: expected an itemrust-analyzer syntax-error
expected item, found keyword let
consider using const or static instead of let for global variables
Hovering the whitespace between let and x
Syntax Error: expected an item rust-analyzer syntax-error
expected item, found keyword let
consider using const or static instead of let for global variables
Syntax Error: expected BANG rust-analyzer syntax-error
Syntax Error: expected {, [, ( rust-analyzer syntax-error
Syntax Error: expected SEMICOLON rust-analyzer syntax-error
Likewise, hovering the rest of parts of the statement gives similar yet slightly different messages.
As you can see, some of those messages are surprising.
The red underline squiggles are also a bit surprising:
What I expected
I expected the whole statement to be underlined consistently, and the hover message to only contain the relevant error message (i.e. the one that you get when hovering the let keyword, see section above).
The text was updated successfully, but these errors were encountered:
Versions
rust-analyzer
: v0.4.1539rustc
: 1.70.0Reproducer
Simply write a top-level let statement.
Explanation
Hovering the
let
keyword givesHovering the whitespace between
let
andx
Hovering
x
givesLikewise, hovering the rest of parts of the statement gives similar yet slightly different messages.
As you can see, some of those messages are surprising.
The red underline squiggles are also a bit surprising:
What I expected
I expected the whole statement to be underlined consistently, and the hover message to only contain the relevant error message (i.e. the one that you get when hovering the
let
keyword, see section above).The text was updated successfully, but these errors were encountered: