Syntax Highlighting

I wonder if it would be possible, if easy enough, to make the user types display, in the chosen color, more consistently. At the moment it doesn’t highlight when actually creating a new class or record or when invoking the the new type.
That would make readability better in my opinion.
Or is there a design decision against or a parser difficulty or some such preventing such a nicety.

We can have a look at that, for sure. I don’t have VS in front my me right now, but just in case, can you give me a concrete example (screenshot or even better test project) where type highlighting does not work or does not work consistently? Thanx!

Ok, maybe a couple of days from now, but will do,
Michael

Hi Marc here is a screenshot showing the highlighting I mean.
MyClass does highlight in the default color (although I would change that to more like teal) but as can be seen, when MyClass is created MyClass = class, it shows only white and then when invoking it with the new keyword it still doesn’t highlight but stays the same color white.

Also when the other class, MyOtherClass inherits MyClass, the highlighting does work.

That’s the inconstancy.

In Microsoft C# all these instances show their teal color making reading and seeing that something is a type a bit easier.

Same here I believe. If all instances of MyClass was the same highlight color.

And of course other instances of user defined types, like MyOtherClass.

Hi Marc, I am not sure how to send a project, except to send maybe all the project files in the directory, but it probably isn’t necessary as the behaviour shown in the screen shot is always the same.

Hi Marc here is a screenshot showing the highlighting I mean.

As seen here all the user defined classes will highlight when used as a type behind a colon. var fTest : mYClass. Also when used as being inherited from in MyOtherClass =
Class(MyClass).
However even though they are clearly classes/types they are not colored when following the new operator. myVar := new MyClass. And in the initial creation of the class MyClass = class.
This is the inconsistency I mean


Regards Michael

Hi again, one more thing I just realized is that the same lack of highlighting applies to built in types when using the new operator as well.

Hi Michael,

:= new MyClass

is the call to the constructor (method of the class) and such call is not highlighted in Oxygene and this is as designed.

Highlighting for variable definition and type inheritance works because this is another use case for a type name.

I’m not sure if it makes sense to change behavior that’s been there for a long time.

Regards, Kate

Thanks for Thanks for the reply Kate. I get the reluctance to change. How about MyClass = class. MyClass is clearly a type and if you are going to bother highlighting types at all it seems to me that it would be useful and enhance readability to have all the instances of the type highlighted the same. I get the the other instance is referecing the constructor but it is also showing a Type name. My experience with Microsoft C Sharp highlighting where all such types are shown in the same colour makes readability better.

Regards Michael

Hi Michael,

I was a bit hesitant at first since this behavior has been around for years, but agree that consistent highlighting of the type would make things more readable. Will log an issue :raising_hands:

Regards, Kate

Logged as bugs://E27691.

Hi Kate, I am very pleased to hear that. I have been hoping for something like that ever since I first came across Oxygene as better Delphi, and with VS integration I was always hopeful and that was one of the first things I asked Marc about, way back.

Many regards, Michael.