Values are not colored in code

Loving the syntax coloring. (A list of recognized languages would be helpful, but that’s another topic.)

Consider this code:

var v as variant
v = "hi"
v = &h00
v = &u0A
v = 2
v = 12.4
v = true
v = false
v = &cFFFEFD00
v = nil

Note how the string “hi” is colored but other values are not? I think they should be.

Edit: More colors have been added since I originally posted this.

2 Likes

in the ide i used different colors for strings and values.
REM usually Yellow on Black.
Classes in Yellow.
Orange for = ()

Snap_2020.07.28_20h51m10s_001_

Snap_2020.07.28_20h58m57s_003_

Snap_2020.07.28_21h02m53s_004_

I‘ve already reported this to Dana yesterday. We will see.

I always use monokai, it’s clean and definitely soft for the eyes.

at amiga there was 4 colors in blitz basic and white as editor background is definitively bad for eyes.
thats why i choose soft dark blue.

1 Like

The syntax highlighting is done via HighlightJS and Discourse with a custom ruleset, and by definition behaves differently from Xojo itself. We’re happy with the way it is now, though of course it may change and improve in the future.

Sorry that’s beyond my time :sweat_smile:

You get a like for mentioning retro computing!

2 Likes

C64 and Amiga was a great time.

Ask garry of he’ll donate his plugin
it does a nice job with the code markdown tags for xojo code

2 Likes

Garry was actually kind enough to post Xojo highlightjs definitions on Github a while back, and we’ve used some of it here. We’ll go ahead and use a bit more - thanks to Garry for both creating and sharing that effort!

3 Likes

I edited the original post to add more examples, and as you can see, there is now more colorization. Thanks!

Colors could be bit more visible in Dark Mode.

1 Like

there are only one color for both light & dark mode?
how it looks today
Snap_2020.07.31_07h05m30s_001_
string could be black at light mode and white in dark mode. (better as purple)
the blue more contrast brighter & darker for both modes.
integer & double could be in the same color.

1 Like

Things like &u9 should be also colored as String. What do you think?

Xojo_IDE

The IDE also displays the values in the color of a string.

1 Like

maybe the value as number not the prefix.

The keyword Call is also not highlighted.

Var tab As String = &u9
Call ...
1 Like

To keep it all in one place…

var v as variant
v = "hi"
v = &h00
v = &u0A
v = 2
v = 12.4
v = true
v = false
v = &cFFFEFD00
v = nil
call v.Type
' Comment 1
// Comment 2
REM Comment 3
1 Like

You’re very welcome @Travis_Hill

Now I understand what you meant by “allowing edits to be seen by other users would be nice” in another thread…
Until I read your post quoted here, I couldn’t understand what’s wrong. Now, I just know it was different before…