evandrocoan / PlantUmlDiagrams

A fork from https://github.com/jvantuyl/sublime_diagram_plugin package for Sublime Text, to render diagrams in your source code
Other
38 stars 10 forks source link

Is syntax highlighting for DiagramEx fully functional? #10

Open kyleboyle opened 4 years ago

kyleboyle commented 4 years ago

Im not getting highlighting for a lot of cases. like for known colors, @startuml, activate, box, loop, etc. also looks like it doesn't support external message arrows for sequence diagrams like ->] or [<- hope this demonstrates: Screen Shot 2019-11-08 at 11 45 04 AM

evandrocoan commented 4 years ago

As it seems on your screenshot:

  1. It either does not support the default Monkay color scheme
  2. Or it is not funcional as you said, i..e, it is incomplete.

To develop it, I used the https://github.com/evandrocoan/NotepadPlusPlusColorScheme, then, you can try using that color scheme. If the problem is fixed, then, it means I just need to fix this syntax to correctly work with other color schemes as Monkay.

kyleboyle commented 4 years ago

Same result. Looks like it might be invalid whitespace expectations for some of them:

Screen Shot 2019-11-12 at 12 35 17 PM

kyleboyle commented 4 years ago

I'm not really sure how to go about adding external arrows (instead of an entity name, there is a bracket without whitespace), or fix the control keywords that are not matched if they start in the first column. I suspect another regex is interfering but I'm not sure how to debug that. The control keywords regex matches as expected on its own.

evandrocoan commented 4 years ago

It should be a quite simple solution. I will look into it when I can.

kyleboyle commented 4 years ago

can we steal this one:

https://github.com/qjebbs/vscode-plantuml/blob/master/syntaxes/diagram.yaml-tmLanguage

evandrocoan commented 4 years ago

That can work too. Just need to see if some conversion is required or if it just work out of the box.

kyleboyle commented 4 years ago

In the above file, if i change the "support.variable" to something else eg: "entity.name" things seem to work out: Screen Shot 2019-11-14 at 3 45 24 PM Screen Shot 2019-11-14 at 3 45 29 PM

I used PackageDev to convert the yaml-tmLanguage to .tmLanguage. I have my experiment here: https://github.com/kyleboyle/PlantUmlDiagrams/pull/2

Let me know your thoughts. There might be some work to use categories that better line up with the sublime text syntax categories.

evandrocoan commented 4 years ago

It would be better if we could automatically keep our syntax up to date with the VSCode one.

kyleboyle commented 4 years ago

Could you explain what you mean? The color schemes I've looked at don't have a style defined for support.variable. I suppose it could be left alone and the connection endpoints will have the default style, though that feels wrong to me.

evandrocoan commented 4 years ago

I meant, instead of developing two syntaxes, one for Sublime Text, the other for VSCode, we could develop only one for VSCode and automatically import any changes to the VSCode syntax, into our Sublime Text syntax. Therefore, I would look on how the update process from the VSCode repository could be integrated into the Sublime Text one (this one) automatically.