racket / syntax-color

Other
8 stars 16 forks source link

Inconsistent s-exp comment highlighting for Racket and student languages #13

Closed sorawee closed 1 year ago

sorawee commented 2 years ago
#;(a b)

1

#;(a b)

is colored as shown here:

Screen Shot 2022-09-04 at 3 21 20 PM

The first and second occurrence of #;(a b) are colored differently, which is very weird, especially when we are in student languages.

I suspect that this is because the syntax colorer for student languages is just the standard Racket's color lexer. But without the #lang line, it cannot find the relevant information to highlight correctly.

Note that the first occurrence is fully colored as a comment. This makes sense, because before #lang line, S-exp comment is colored like that too.

#;(a b)

#lang racket

#;(a b)
Screen Shot 2022-09-04 at 3 26 38 PM
rfindler commented 1 year ago

Looks like this was fixed for the #lang example above by this commit and I'm seeing slightly different, but still wrong, behavior in the teaching languages:

Screenshot 2023-02-22 at 2 16 52 PM

but that might also be a problem with the module lexer, perhaps in the way that it is using (or not using) racket-lexer*, as I see the same bad behavior as in this screenshot in both menu-based teaching languages and in the module language.