nvarner / typst-lsp

A brand-new language server for Typst, plus a VS Code extension
MIT License
1.19k stars 77 forks source link

LSP Crash on opening any files #175

Closed Myriad-Dreamin closed 1 year ago

Myriad-Dreamin commented 1 year ago

Issue

When opening a file, it crashes at once.

Logs

[Info  - 1:01:54 PM] Folder added to workspace: /path/to/workspace/
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src\workspace\source_manager.rs:180:61
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 1:01:54 PM] The Typst Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
Myriad-Dreamin commented 1 year ago

I cannot set "RUST_BACKTRACE=full" for a VSCode process so no full bracktrace :(. Edited AppData\Local\Programs\Microsoft VS Code\bin\code.cmd with appending set RUST_BACKTRACE=full.

BeitianMa commented 1 year ago

I have encountered the same situation, restarting VSCode and reinstalling LSP did not work, looking for a solution.

BeitianMa commented 1 year ago

As a temporary solution, I rolled back the LSP version to 0.62 on VSCode and found that it worked fine.

nvarner commented 1 year ago

Is anyone who is having this issue able to share more details about the files they're working with? I'll investigate, but I haven't had this happen locally.

nvarner commented 1 year ago

I think I've figured out the error. It should be resolved in #176. Until I can get the changes released, downgrading to 0.6.2 is a good solution.

nvarner commented 1 year ago

This should be fixed in the latest version (v0.7.1) of the extension. If not, please reopen this issue.