Skip to content
New issue

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

Syntax Error: expected SEMICOLON, Rust Analyzer Bug #18745

Open
PNDTG opened this issue Dec 23, 2024 · 19 comments
Open

Syntax Error: expected SEMICOLON, Rust Analyzer Bug #18745

PNDTG opened this issue Dec 23, 2024 · 19 comments
Labels
A-salsa might be a salsa issue Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug

Comments

@PNDTG
Copy link

PNDTG commented Dec 23, 2024

#4829

This is the continuation of the closed issue above.

Image

I started having this issue a couple of weeks ago, I'm certain there is no issue with my syntax because even when I remove everything and just leave in the standard main function with the "Hello, World!" text it still gives this error.

The issue goes away if I restart VSCode as people did in the mentioned thread.
It also goes away if I make a new file and copy all my code into it again.

When I run cargo run for that project it builds with no errors.

Although I could not exactly reproduce this error consistently, I think moving lines using Alt+ArrowKeys could cause this sometimes.

@PNDTG PNDTG added the C-bug Category: bug label Dec 23, 2024
@lnicola
Copy link
Member

lnicola commented Dec 23, 2024

Do you have any errors in the logs (Output pane)?

@PNDTG
Copy link
Author

PNDTG commented Dec 23, 2024

Do you have any errors in the logs (Output pane)?

Yes.

Image

But no issue with cargo run:

Image

@ChayimFriedman2
Copy link
Contributor

That's not what @lnicola meant; he asked if you have errors in the Output pane, under Rust Analyzer Language Server. Panics in rust-analyzer itself.

@PNDTG
Copy link
Author

PNDTG commented Dec 23, 2024

That's not what @lnicola meant; he asked if you have errors in the Output pane, under Rust Analyzer Language Server. Panics in rust-analyzer itself.

Oh, I'm sorry I didn't read their message properly.
No... my Output pane is empty.

@ChayimFriedman2
Copy link
Contributor

That's weird... Are you sure there aren't any panics there? (before you restart r-a).

@lnicola
Copy link
Member

lnicola commented Dec 23, 2024

also make sure you're looking at the RA channel:

Image

@PNDTG
Copy link
Author

PNDTG commented Dec 23, 2024

I unfortunately restarted VSCode to continue working on my code before I saw this.
I don't have that problem anymore, but I'll try to recreate it if possible.

The Rust Analyzer Output is empty right now, I will make a new comment if I can recreate it.

@PNDTG
Copy link
Author

PNDTG commented Dec 23, 2024

I haven't been able to recreate it yet, I'm just coding away, if it happens I will make a new comment immediately.

This is my current Output pane for RA-LS:

Image

@Veykril
Copy link
Member

Veykril commented Dec 24, 2024

It is unlikely you'll run into it again any time soon as the panic that likely caused that was fixed (and before easily triggerable), so I'll close this for now but if you run into it again please do open a new issue / reopen this.

@Veykril Veykril closed this as completed Dec 24, 2024
@PNDTG
Copy link
Author

PNDTG commented Dec 24, 2024

@Veykril I actually ran into it at least half a dozen times in the past week. But I understand, in case it happens again I will reopen it.
Maybe it got scared that I'm reporting on it lol.

@Veykril
Copy link
Member

Veykril commented Dec 24, 2024

The panic itself got fixed within the last week, so this monday's release has it fixed that's why I made that comment (sorry for leaving that info out)

@PNDTG
Copy link
Author

PNDTG commented Dec 24, 2024

Oh! That's actually great! Thank you!

@PNDTG
Copy link
Author

PNDTG commented Dec 24, 2024

It unfortunately happened again right now.

Image

Here's my whole RA-LS Output:
Rust_Analyzer_Language_Server_Output.txt

The Specific error that VSCode notified me of and just looks odd compared to everything else is this:

[Error - 12:52:46 AM] Request textDocument/diagnostic failed.
  Message: request handler panicked
  Code: -32603 
[Error - 12:52:46 AM] Document pull failed for text document file:///c%3A/Users/{TheUser}/Documents/Rust/01/kv_handler/src/persistent_hash_map.rs
  Message: request handler panicked
  Code: -32603 

I hope this helps.

I forgot to mention in my opening comment:
VSCode version: 1.96.2
Rust Analyzer version: 0.3.2228
Rust version: 1.83.0

@Veykril @lnicola, I think I'm not allowed to reopen the issue myself. Could you please reopen it?

In case you don't get notification about this I will make another issue linking to this in a day or two.

@Veykril
Copy link
Member

Veykril commented Dec 25, 2024

Odd, that is missing the panic message 😕

@Veykril Veykril reopened this Dec 25, 2024
@PNDTG
Copy link
Author

PNDTG commented Dec 25, 2024

Is it really a panic issue? The rust analyzer keeps working fine, it counts all the warnings and other errors correctly but it suddenly starts asking for an unnecessary semicolon. Putting a semicolon there doesn't fix the issue, it just adds a warning telling me to remove it.

Is there any other log output I can send here? I unfortunately restarted my laptop since last night so it's no longer there but in case I encounter it again.

@Veykril
Copy link
Member

Veykril commented Dec 26, 2024

[Error - 12:52:46 AM] Request textDocument/diagnostic failed.
  Message: request handler panicked
  Code: -32603 
[Error - 12:52:46 AM] Document pull failed for text document file:///c%3A/Users/{TheUser}/Documents/Rust/01/kv_handler/src/persistent_hash_map.rs
  Message: request handler panicked
  Code: -32603 

panics don't bring down the server, they just fail a request

@Veykril
Copy link
Member

Veykril commented Dec 26, 2024

Okay I figured out the issue, but not why it occurs. What we are observing here is not panic, but a Cycle unwind (hence no stracktrace). Now why that is not being caught correctly by salsa I have no idea

@Veykril Veykril added Broken Window Bugs / technical debt to be addressed immediately A-salsa might be a salsa issue labels Dec 26, 2024
@PNDTG
Copy link
Author

PNDTG commented Dec 26, 2024

Oh, I was under the impression that panics would halt the whole server. It's cool to see this being worked on in action. Wish you guys the best in finding it, in case you needed anything let me know I'll try to help as best as I can.

@Veykril
Copy link
Member

Veykril commented Dec 28, 2024

Actually, maybe someone else can chime in if they know, but were cycles ever caught correctly by our request infra or have we only ever observed them via tests? If I see things right we are actually required to catch them manually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-salsa might be a salsa issue Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

4 participants