raddebugger icon indicating copy to clipboard operation
raddebugger copied to clipboard

Added syntax highlighting for .odin files

Open leidegre opened this issue 1 year ago • 1 comments

This PR adds syntax highlighting for .odin files (Odin programming language) and is based on the txti_token_array_from_string__cpp function.

Key differences are:

  • Set of keywords
  • #meta is treated like an identifier
  • Identifier with leading Upper_Case is treated as a type name

I added a TXTI_TokenKind_Type and mapped that to DF_ThemeColor_CodeType.

Example

image

Let me know if you want me to adjust things.

I tried out the 4coder editor and it was a joyful experience, I think I will try to use this more.

leidegre avatar Jan 20 '24 13:01 leidegre

@gingerBill thanks for taking a look. I only started my Odin journey last week and really appreciate the help.

leidegre avatar Jan 20 '24 14:01 leidegre

Held off on this because I was stalled on some other stuff, and I needed to deduplicate stuff in the TXTI and TXT layers. Thanks for looking into this. I've merged this by hand in 4bc82db69eed8b563ab4ea5f4a86e56bb783d128, currently just on the dev branch. This isn't full Odin support but will enable the bare minimum stuff - syntax highlighting, go-to-definition, hover-eval, and so on (there may still be holes with such features as they depart from being C-style, e.g. . operator for symbol names, and so on). This will be in the next release.

ryanfleury avatar Mar 26 '24 18:03 ryanfleury