Systems-Modeling / SysML-v2-Release

The latest incremental release of SysML v2. Start here.
GNU Lesser General Public License v3.0
457 stars 64 forks source link

Eclipse Implementation - no comment highlighting #58

Closed EldrML closed 1 year ago

EldrML commented 1 year ago

Having played around with this for a while, I'm finding that within Eclipse IDE 2022-09 (DSL & Java Package version), no sysml files seem to have greentext for comments. The keywords are bolded and colored appropriately, so I am confused what is going wrong--it almost seems like the comments // and /* */ aren't being detected for some reason.

I am very much a beginner to Eclipse, xtext, etc, so if there is any simple thing I've missed during the installation path, it wouldn't be the first time.

seidewitz commented 1 year ago

You didn't miss anything. Somewhere along the way, the green highlighting stopped working in our editors. I'm not sure why, and it hasn't really been a priority to fix.

Note, though, that in the SysML v2 notation, there is an important difference between "notes", written using // or //* ... */ and "comments" using /* ... */. Notes are like lexical comments in programming languages – they are simply ignored like whitespace and not parsed. A comment, on the other hand, is actually a model element and is parsed into the abstract syntax tree, like comments in SysML v1 and UML. A comment can even have a name:

comment aComment /* comment text */

So it might make sense to eventually get the green text back for notes, but probably not for comments.

EldrML commented 1 year ago

That makes sense: with that contextualization, I was referring more specifically to notes highlighting, rather than comments.

Thank you!

seidewitz commented 1 year ago

Your comment made me take another look at the Xtext highlighting configuration, and it wasn't too hard after all to figure out what the problem was. It will be fixed in the next public release (2023-02) which should be published soon. (See SysML v2 Pilot Implementation PR 478.)

seidewitz commented 1 year ago

This is fixed in the 2023-02 Release.