-
Notifications
You must be signed in to change notification settings - Fork 75
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
How to use this LSP with the KDE Kate text editor #404
Comments
I installed {
"servers": {
"typ": {
"command": ["/nix/store/ax813pfbcg9sjzyasam9paw432bakfjf-typst-lsp-0.12.0/bin/typst-lsp"],
"highlightingModeRegex": "^Typst$"
}
}
} Could be a problem with the specific package you're using, but either way the above worked for me. You might have to create a |
@PgBiel: Thank you for your reply. I have now set up a new Filetype for Typst. But there is no syntax highlighting for Typst-specific keywords. Punctuation, brackets and strings are highlighted, but that is all. I expected the Do you get Typst-specific syntax highlighting with |
In short, there's no good way to provide syntax highlighting to every editor. This extension has the best support for VS Code(ium), so other editors will usually be worse for now. Kate seems to use its own custom format for syntax highlighting, which means writing and maintaining a syntax highlighting file just for Kate. However, from what you've said and some brief research, Kate seems to support semantic highlighting. It would require some code changes, but it would be an easier way to get Typst syntax highlighting in Kate. Ultimately, this means there's probably no quick fix right now. |
I put some time into investigating this. It looks like Kate in particular has only very limited support for semantic tokens. This probably means Typst won't have very good syntax highlighting in Kate unless someone writes a Kate-specific grammar for the language. You'll also need to update your LSP configuration so that typst-lsp actually attempts to use semantic tokens. {
"servers": {
"typst": {
"command": ["/your/path/to/typst-lsp"],
"url": "https://github.com/nvarner/typst-lsp",
"highlightingModeRegex": "^Typst$",
"initializationOptions": {
"semanticTokens": "enable"
}
}
}
} Choosing Rust syntax highlighting is technically wrong, since that just tells Kate to imagine your Typst code is really just Rust. That means it will probably highlight many things incorrectly. However, it's possible that this will give better results than semantic tokens alone, just because of the limitations of Kate's implementation. |
(Extremely) relevant Kate MR: https://invent.kde.org/utilities/kate/-/merge_requests/1247 |
I have done so, and the I have a few questions on which I will get back to you. |
I have tryed all these things from kate flatpack and nothing works. Lsp even don't starts. |
Feature Request
Dear Folks,
Thank your for creating this LSP.
I am a long time user of the KDE
kate
text editor and would like to use the typst-lsp server withkate
.I have installed the AUR package
typst-lsp-bin
from https://aur.archlinux.org/packages/typst-lsp-bin.I am trying to get
kate
to recognize and usetypst-lsp-bin
but have not been able to do so thus far.The recommended syntaxes to add a new language server for
kate
are shown here.I added the following JSON block to my
settings.json
forkate
as shown below:However, I ended up with the following error:
Does
typst-lsp
only supportVSCode
?It would be great if
typst-lsp
could support other text editors as well.Kindly make it usable with
kate
or let me know the correctJSON
syntax.Many thanks.
The text was updated successfully, but these errors were encountered: