PlantUmlDiagrams icon indicating copy to clipboard operation
PlantUmlDiagrams copied to clipboard

Is syntax highlighting for DiagramEx fully functional?

Open kyleboyle opened this issue 5 years ago • 10 comments

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

kyleboyle avatar Nov 08 '19 15:11 kyleboyle

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.

evandrocoan avatar Nov 09 '19 00:11 evandrocoan

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 avatar Nov 12 '19 16:11 kyleboyle

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.

kyleboyle avatar Nov 12 '19 20:11 kyleboyle

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

evandrocoan avatar Nov 13 '19 02:11 evandrocoan

can we steal this one:

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

kyleboyle avatar Nov 13 '19 13:11 kyleboyle

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

evandrocoan avatar Nov 14 '19 04:11 evandrocoan

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.

kyleboyle avatar Nov 14 '19 19:11 kyleboyle

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

evandrocoan avatar Nov 14 '19 22:11 evandrocoan

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.

kyleboyle avatar Nov 15 '19 13:11 kyleboyle

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.

evandrocoan avatar Nov 15 '19 16:11 evandrocoan