nvarner / typst-lsp

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

vscode extentions bug on NixOS #338

Open Jaggernaute opened 11 months ago

Jaggernaute commented 11 months ago

Issue

Syntax highlighting isn't present in .typ files in VSCode on NixOS, my files are all gray, even if the text editor detects the language as Typst, and nothing happens on saving the document. The CLI tools works well ... I can compile ... I'm sorry if I can't give you more information right away, I'm not really a VSCode user, I primarily use the Jetbrains suite, so if I missed anything please ask me, so I can give you any information that I may have missed

Logs

[Info  - 6:36:21 PM] File written to /home/jaggi/Documents/tdd-stuff/demande-subvention-istic/letter_template.pdf
[Trace - 6:36:21 PM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {
    "changes": [
        {
            "uri": "file:///home/jaggi/Documents/tdd-stuff/demande-subvention-istic/letter_template.typ",
            "type": 2
        }
    ]
}

[Trace - 6:36:23 PM] Sending request 'textDocument/hover - (6)'.
Params: {
    "textDocument": {
        "uri": "file:///home/jaggi/Documents/tdd-stuff/demande-subvention-istic/letter_template.typ"
    },
    "position": {
        "line": 0,
        "character": 43
    }
}

[Trace - 6:36:23 PM] Received response 'textDocument/hover - (6)' in 0ms.
No result returned.
Enter-tainer commented 10 months ago

the typst cli and typst-lsp are 2 different things.

typst-lsp use a bundled binary in the extension. generally bundled binary doesn't work on nixos because of ... nixos. I'd expect nix user are always familiar with elfpatch or something.

Jaggernaute commented 10 months ago

I'd expect nix user are always familiar with elfpatch or something.

We all start somewhere ...

nvarner commented 10 months ago

@Jaggernaute are the logs you posted the complete logs? I'd expect more than just that. It looks like typst-lsp is aware of one of your documents, but I don't see where it was told about that document. There's also a lengthy initialization step that might hold information about this problem.

But given those logs, (as a non-NixOS expert) I don't think NixOS is directly responsible for this, since I'd otherwise expect it to crash before it got here :)

PgBiel commented 10 months ago

Can you still reproduce this on the latest LSP version (0.11.0)? Did you download the Typst LSP extension from the VSCode marketplace, or did you compile from source? Did you change its configuration in any way? Are you using VSCode or VSCodium? And are you using Flatpak?

The LSP works fine for me (NixOS 23.05 as well, on VSCodium with and without Flatpak), so we will need more information to diagnose the problem you're facing.