add config example for `coc.nvim` users
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.
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 :(.
|
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
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 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
Hi, set semanticTokens.enable to true in :CocConfig and see if it works.
@jfab20 Hi, set
semanticTokens.enabletotruein:CocConfigand 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:
Is this how it is supposed to be?
@jfab20
It looks the same on my side. I think this is what it is supposed to be.
Any chance to get it merged?