andorsk / d2-mode

emacs major mode for d2 graphs
GNU General Public License v3.0
63 stars 7 forks source link

d2lang syntax highlighting #36

Open avelino opened 1 year ago

avelino commented 1 year ago

we need to give syntax highlighting support to the d2 language, the other editor versions that are on the official language site have color support (editor support)

when forcing d2-mode loading on open d2-file

Screenshot 2023-01-03 at 20 00 39
andorsk commented 1 year ago

thanks @avelino! I'll try to get to that this week!

andorsk commented 1 year ago

@avelino thanks for the comments. Finally getting to it this weekend.

Seems like there are two issues bundled in this. re: syntax highlighting, I believe we already support this?

https://github.com/andorsk/d2-mode/blob/main/d2-mode.el#L92

image

Is the issue that there's inconsistency between syntax highlighting across d2 editors? I can see about lining it up more with the vim package https://github.com/terrastruct/d2-vim/blob/master/syntax/d2.vim if that's the right direction to go.

andorsk commented 1 year ago

re: opening the d2-mode opening a d2 file, I haven't been able to recreate the issue. Can anyone else recreate it?

image

It's possible you're running an old version of d2-mode? Melpa stable might be old. We might need to upgrade the tag to make sure people get the latest version.

Once I get #30 done, I'll probably upgrade the patch tag.