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

LSP crashed #28

Closed
Tartasprint opened this issue May 4, 2023 · 2 comments
Closed

LSP crashed #28

Tartasprint opened this issue May 4, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Tartasprint
Copy link

Tartasprint commented May 4, 2023

Describe the bug

The LSP went into unreachable code :

'internal error: entered unreachable code: unexpected rule in node: range', /home/user/.config/cargo/registry/src/index.crates.io-6f17d22bba15001f/pest-language-server-0.3.2/src/lsp.rs:389:50

To Reproduce

I couldn't reproduce the bug. I was trying various buggy grammars, the last one being r={'''..'''}. It might be linked to the issue pest-parser/pest/issues/853. But the link is not direct/obvious since after restarting the server, with the same files, it did not report any error.

Reproduction File

All the *.pest files appearing in the pest-parser/pest or pest-parser/book repositories, and the tmp.pest file:

r={'''..'''}  

Log

[Info  - 11:41:47 AM] Pest Language Server v0.3.2
[Info  - 11:41:47 AM] Checking for updates...
[Info  - 11:41:48 AM] Opening file:///home/user/Projets/_Contrib_/pest/trys/tmp/tmp.pest
[Info  - 11:41:48 AM] Reloading all diagnostics
[Info  - 11:41:48 AM] 	Reloading diagnostics for file:///home/user/Projets/_Contrib_/pest/trys/tmp/tmp.pest
[Info  - 11:41:48 AM] Opening file:///home/user/Projets/_Contrib_/pest/pest/meta/src/grammar.pest
[Info  - 11:41:48 AM] Reloading all diagnostics
[Info  - 11:41:48 AM] 	Reloading diagnostics for file:///home/user/Projets/_Contrib_/pest/pest/meta/src/grammar.pest
[Info  - 11:41:48 AM] 	Reloading diagnostics for file:///home/user/Projets/_Contrib_/pest/trys/tmp/tmp.pest
[Info  - 11:41:57 AM] Reloading all diagnostics
[Info  - 11:41:57 AM] 	Reloading diagnostics for file:///home/user/Projets/_Contrib_/pest/pest/meta/src/grammar.pest
[Info  - 11:41:57 AM] 	Reloading diagnostics for file:///home/user/Projets/_Contrib_/pest/trys/tmp/tmp.pest
thread 'main' panicked at 'internal error: entered unreachable code: unexpected rule in node: range', /home/user/.config/cargo/registry/src/index.crates.io-6f17d22bba15001f/pest-language-server-0.3.2/src/lsp.rs:389:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Info  - 11:42:00 AM] Connection to server got closed. Server will restart.
[Error - 11:42:00 AM] Request textDocument/codeAction failed.
Error: Connection got disposed.
	at Object.dispose (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:40:4058)
	at Object.dispose (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:45:9559)
	at td.handleConnectionClosed (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:47:9053)
	at td.handleConnectionClosed (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:50:12094)
	at r (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:47:8735)
	at Lu.invoke (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:13:9583)
	at di.fire (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:13:10347)
	at vt (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:14:10892)
	at Lu.invoke (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:13:9583)
	at di.fire (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:13:10347)
	at xs.fireClose (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:14:523)
	at Socket.<anonymous> (/home/user/.vscode/extensions/pest.pest-ide-tools-0.3.2/build/client.js:14:1297)
	at Socket.emit (node:events:526:28)
	at Pipe.<anonymous> (node:net:687:12)

Expected behavior

I expect the LSP not to crash.

Environment (please complete the following information):

  • OS: Linux jabr 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
  • Editor: VSCode v1.77.3
  • Server Version: v0.3.2
@Tartasprint Tartasprint added the bug Something isn't working label May 4, 2023
@Jamalam360
Copy link
Contributor

This is an error with the range operator in general, caused by the fragile code that I am yet to fix

working on a temporary hotfix for now, until I have time to restructure the code

@Jamalam360 Jamalam360 self-assigned this May 4, 2023
@Jamalam360
Copy link
Contributor

Thank you for reporting, hotfixed in V0.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants