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

add config example for coc.nvim users #506

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tanloong
Copy link

@tanloong tanloong commented Jun 11, 2024

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.

@Myriad-Dreamin
Copy link
Collaborator

This PR runs into same situation as #497, however, I don't quite know how to solve these error :(.

@astrale-sharp
Copy link
Collaborator

|
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

@tanloong
Copy link
Author

tanloong commented Jul 2, 2024

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.

@jfab20
Copy link

jfab20 commented Jul 9, 2024

@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?

@tanloong
Copy link
Author

tanloong commented Jul 9, 2024

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

@jfab20
Copy link

jfab20 commented Jul 9, 2024

@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?

@tanloong
Copy link
Author

tanloong commented Jul 9, 2024

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

@tanloong
Copy link
Author

Any chance to get it merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants