-
Notifications
You must be signed in to change notification settings - Fork 182
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
Syntax highlighting in popups, returned by 3rd party language server, not work #2472
Comments
|
No, this is not used for the syntax highlighting in popus. You can either add "mdpopups.sublime_user_lang_map": {
"typst": [["typst", "typc"], ["Typst/Typst"]]
} to you Preferences.sublime-settings user settings, or better provide a PR upstream at https://github.com/facelessuser/sublime-markdown-popups/blob/master/st3/mdpopups/st_mapping.py so that other users can also benefit from Typst syntax highlighting in popups. See https://facelessuser.github.io/sublime-markdown-popups/settings/#mdpopupssublime_user_lang_map It is also possible to extend the language map from a LSP-tinymist helper package via Line 967 in 68c7031
|
I'm not sure, how to handle this, so, if I understand correctly, there are some possible solutions:
|
@istudyatuni this comment gives the solution on how to add syntax highlighting in popups for Typst From the command palette select {
"mdpopups.sublime_user_lang_map": {
"typst": [["typst", "typc" ], ["Typst/Typst" ] ]
}
} Restart ST, and now hover over the variables. You should see syntax highlighting. LSP uses mdpopus(sublime-markdown-popups) to render the markdown in popups. A better way would be to submit a PR to mdpopus to add support for Typst. (here is a PR example of how to do that) If you have any additional questions feel free to ask. |
Strangely, but this doesn't work for me. Probably after the LSP update it will work, but I can't check it now |
@predragnikolic I tested it in clean installation, and it still don't work for me Preferences
{
"mdpopups.sublime_user_lang_map": {
"typst": [["typst", "typc"], ["Typst/Typst"]],
},
"font_size": 12,
} LSP Preferences
// Settings in here override those in "LSP/LSP.sublime-settings"
{
"clients": {
"tinymist-lsp": {
"enabled": true,
"command": [
"/usr/bin/tinymist"
],
"selector": "text.typst",
"auto_complete_selector": "text | markup",
"initializationOptions": {
"exportPdf": "never",
}
},
},
}
Installed packages: LSP, Typst Also popup differs from you screenshot - there is no |
It doesn't work because the What you would need to do is to create a separate syntax definition for "mdpopups.sublime_user_lang_map": {
"typst": [["typst"], ["Typst/Typst"]],
"typc": [["typc"], ["User/MyTypcSyntax"]],
}, or include the syntax into a LSP-tinymist package (see https://github.com/sublimelsp/LSP-pyright/blob/32ab2159cb79088b52684f068dcd23586ddecdc9/syntaxes/pyright.sublime-syntax and https://github.com/sublimelsp/LSP-pyright/blob/32ab2159cb79088b52684f068dcd23586ddecdc9/plugin.py#L88-L90 for an example in LSP-pyright, which similarly works around Pyright using non-standard syntax for its popups). |
and I'm not sure, how to fix it
Describe the bug
Tinymist language server returns something like this on hover:
I tried to add new file_extension
typc
to syntax definition, but this doesn't helpTo Reproduce
Steps to reproduce the behavior:
test()
Expected behavior
Code block with definition is highlighted
Screenshots
Second screenshot from vscode
Logs
Paths are redacted
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: