-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Zig syntax highlighting support in the editor #7888
Zig syntax highlighting support in the editor #7888
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shipit!
:indent {:begin #"^.*\{[^}\"\']*$|^.*\([^\)\"\']*$|^\s*\{\}$" | ||
:end #"^\s*(\s*/[*].*[*]/\s*)*\}|^\s*(\s*/[*].*[*]/\s*)*\)"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, how did you come up with those though? I haven't found anything about indentation in https://github.dev/ziglang/vscode-zig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the indentation rules from the C-ish languages since Zig uses a similar brace structure.
;; This is a simplified implementation of TextMate-style syntax highlighting | ||
;; that allows us to adopt rules from existing .tmLanguage files. At some point | ||
;; we might want to implement full support for TextMate grammars, since it has | ||
;; been widely adopted by modern text editors. To fully support them would take | ||
;; a bit of work. Here are a few useful resources that might help guide this | ||
;; effort in the future: | ||
;; | ||
;; Writing a TextMate Grammar: Some Lessons Learned | ||
;; https://www.apeth.com/nonblog/stories/textmatebundle.html | ||
;; | ||
;; The Language Grammars section from the TextMate manual | ||
;; https://macromates.com/manual/en/language_grammars | ||
;; | ||
;; The Indentation Rules section from the TextMate manual appendix | ||
;; https://macromates.com/manual/en/appendix#indentation_rules | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…7889) * Initial extension C api * Fixed C api test for extension.h * Added initial Zig support to extender config * Moved dmExtensionDesc to public header so that Zig can allocate it. * fixes * Merge fixes * Added Zig syntax highlighting support in the editor (#7888) * Removed experimental enum macro * Added first test for cpp header generation * Updated generation script * Fixed compile errors and made the C functions the base implementation * Added support for enums * Updated extension.h to generate .hpp header * build fix for windows * test fix * win32 compile fix * Fixes to generator scripts * Updated resource system * Updated libs to use latest resource headers * Unified back into a single resource.h * Update documentation. Renamed some struct arguments to make them more consistent * review cleanup * html build fix * compile fix * Update the dmsdk with the hpp files * Added missing test data --------- Co-authored-by: Mats Gisselson <matgis@users.noreply.github.com>
…7889) * Initial extension C api * Fixed C api test for extension.h * Added initial Zig support to extender config * Moved dmExtensionDesc to public header so that Zig can allocate it. * fixes * Merge fixes * Added Zig syntax highlighting support in the editor (#7888) * Removed experimental enum macro * Added first test for cpp header generation * Updated generation script * Fixed compile errors and made the C functions the base implementation * Added support for enums * Updated extension.h to generate .hpp header * build fix for windows * test fix * win32 compile fix * Fixes to generator scripts * Updated resource system * Updated libs to use latest resource headers * Unified back into a single resource.h * Update documentation. Renamed some struct arguments to make them more consistent * review cleanup * html build fix * compile fix * Update the dmsdk with the hpp files * Added missing test data --------- Co-authored-by: Mats Gisselson <matgis@users.noreply.github.com>
User-facing changes