typst-lsp icon indicating copy to clipboard operation
typst-lsp copied to clipboard

add config example for `coc.nvim` users

Open tanloong opened this issue 1 year ago • 8 comments

I am not the first one configuring typst-lsp in coc, @ysl2 has already been trying as in #422, but that issue was closed without a resolution. The original coc languageserver config property initializationOptions is marked as deprecated and now we should use settings.

tanloong avatar Jun 11 '24 20:06 tanloong

This PR runs into same situation as https://github.com/nvarner/typst-lsp/pull/497, however, I don't quite know how to solve these error :(.

Myriad-Dreamin avatar Jun 14 '24 14:06 Myriad-Dreamin

|
123 | pub trait FileIdExt {
    |           --------- method in this trait
124 |     fn with_extension(self, extension: impl AsRef<OsStr>) -> Self;
    |        ^^^^^^^^^^^^^^
    |

this PR didn't touch FileIdExt so it seems like a problem on typst-lsp 's part tbh

astrale-sharp avatar Jun 15 '24 10:06 astrale-sharp

This PR has been open for a while. As @astrale-sharp mentioned, it doesn't change the code and isn't the cause for the failed CI checks. It's straightforward and suits the convenience for coc users. Hope we can merge it.

tanloong avatar Jul 02 '24 05:07 tanloong

@tanloong Sorry if this is not the place to ask this, but can you get syntax highlighting in neovim with coc and typst-lsp? I have installed typst-lsp with coc and it correctly gives me autocompletion suggestions but I have no syntax highlighting. I don't know if this is supposed to be a feature and if so, how can I enable it?

jfab20 avatar Jul 09 '24 00:07 jfab20

@jfab20 Hi, set semanticTokens.enable to true in :CocConfig and see if it works.

tanloong avatar Jul 09 '24 06:07 tanloong

@jfab20 Hi, set semanticTokens.enable to true in :CocConfig and see if it works.

Thanks! Like this right?

{
"semanticTokens.enable": true,
"languageserver": {
    "typst": {
        "command": "typst-lsp",
        "filetypes": ["typst"],
        },
    }
}

I do get highlighting although it is quite minimal, for example neither headings nor math get syntax highlighting, like this:

image

Is this how it is supposed to be?

jfab20 avatar Jul 09 '24 14:07 jfab20

@jfab20 It looks the same on my side. I think this is what it is supposed to be. image

tanloong avatar Jul 09 '24 15:07 tanloong

Any chance to get it merged?

tanloong avatar Jul 22 '24 13:07 tanloong