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

Support For the Yaml version of the TmLanguage #19

Open
Nova38 opened this issue Feb 8, 2025 · 5 comments
Open

Support For the Yaml version of the TmLanguage #19

Nova38 opened this issue Feb 8, 2025 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@Nova38
Copy link

Nova38 commented Feb 8, 2025

Would it be possible to add support for the yaml version of the textmate language definitions? From some experience it is a little nicer to write the language specs in the yaml version is that you don't have to escape the regex as much as in json. It is also mentioned on the vscode docs (https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide).

@RedCMD
Copy link
Owner

RedCMD commented Feb 8, 2025

definitely possible. tho it will take some time

originally I had thought about doing it
but I decided to focus on json cause you needed to run a command to convert the yaml into json anyway
(and I don't like the plist format)

I can create the syntax highlighting
but it'll be too much work to setup the language features like:
error diagnostics, advanced code completions, rename, definitions, code actions etc

I can get integration with RedHat's extension redhat-developer/vscode-yaml#1092
code formatting, basic schema completions, basic schema diagnostics, breadcrumb symbols

otherwise you can download this extension https://marketplace.visualstudio.com/items?itemName=pedro-w.tmlanguage or https://marketplace.visualstudio.com/items?itemName=radium-v.yaml-tmlanguage
microsoft/vscode-textmate#224

@RedCMD RedCMD added the enhancement New feature or request label Feb 8, 2025
@RedCMD
Copy link
Owner

RedCMD commented Feb 8, 2025

for backslash escaping
you need a single escape for json characters bfnrt/" & \u0000
double escape for every regex (single) escape \\
and quad backslash for a single backslash \\\\

@Nova38
Copy link
Author

Nova38 commented Feb 9, 2025

Sweet! I will check out that one as well. Even just the syntax highlighting would be super helpful. Debugging the language kinda still ends up having to be in json anyway as that is what ends up getting used by vscode anyway.

I do also just want to thank you for implementing the call stack thing for debugging the tokenization. It saved so much time debugging compared to having to setup the tokenization CLI and then compare back and forth. It saved my at least a few hours of tedious work.

@RedCMD
Copy link
Owner

RedCMD commented Feb 13, 2025

implementing the call stack

happy to see its in good use 🥳
if you have any suggestions for it. there's #10

slowly getting there
currently reusing the json regex highlighter and doesn't support flow-nesting {} []
Image

seems the YAML repo is on the slower side atm redhat-developer/vscode-yaml#1068

@Nova38
Copy link
Author

Nova38 commented Feb 15, 2025

That makes sense. I have had a few issues with the yaml extension in the past so the fact that it is strapped for resources is not surprising.

Thanks again 💙

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

No branches or pull requests

2 participants