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

Zig syntax highlighting support in the editor #7888

Merged

Conversation

matgis
Copy link
Contributor

@matgis matgis commented Aug 16, 2023

User-facing changes

  • Added rudimentary syntax highlighting for Zig files to the editor.

@matgis matgis changed the title Added Zig syntax highlighting support in the editor Zig syntax highlighting support in the editor Aug 16, 2023
@matgis matgis requested review from vlaaad and JCash August 16, 2023 07:28
Copy link
Contributor

@vlaaad vlaaad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shipit!

Comment on lines +156 to +157
:indent {:begin #"^.*\{[^}\"\']*$|^.*\([^\)\"\']*$|^\s*\{\}$"
:end #"^\s*(\s*/[*].*[*]/\s*)*\}|^\s*(\s*/[*].*[*]/\s*)*\)"}
Copy link
Contributor

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

Copy link
Contributor Author

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.

Comment on lines +24 to +39
;; 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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@JCash JCash merged commit e990c15 into dmsdk-c-api-support Aug 17, 2023
21 of 22 checks passed
@JCash JCash deleted the dmsdk-c-api-support-editor-syntax-highlighting branch August 17, 2023 07:54
JCash added a commit that referenced this pull request Jun 6, 2024
…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>
AGulev pushed a commit that referenced this pull request Jun 25, 2024
…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>
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.

None yet

3 participants