Closed sorawee closed 11 months ago
Yes.
A (not very satisfactory) work-around is the usual "Escape to Racket using @
", like how you'd enter a literal "@"
:
@~a{foo; bar}
@~a{foo@";" bar}
Note that the rule-based syntax highlighter here on GitHub shares the problem of the rule-based racket-mode
.
The optional racket-hash-lang-mode
minor mode available on the hash-lang
branch does handle this. It replaces the "traditional" Racket major mode stuff with code provided by the lang (and in this case, meta-lang) to do syntax highlighting, indent, and expression navigation. Not only does this support entirely different langs, like rhombus, it handles various edge cases like this bug, for #lang racket
, and knows if at-exp
or scribble
is actually used (as opposed to guessing based on a @
character textually).
So, my hunch is that it's not worth the effort (as well as the risk of introducing other bugs) to try to fix most of these remaining edge cases the traditional way. Instead, this would probably be closed by merging the hash-lang
branch, and recommending people enable racket-hash-lang-mode
.
[Someday maybe that should even be enabled by default. But I think there would still be a role for a traditional, Emacs racket-mode
-- one that doesn't need a Racket back end process running, which some people might be unwilling or unable to do, "just to edit a text file".]
FWIW this is definitely fixed on the hash-lang
branch. I've dog-fooding that heavily lately and trying to pin down enough details to marge it to main branch, as soon as I can.
trying to pin down enough details to marge it to main branch, as soon as I can.
To clarify: After Marge Simpson approves, I plan to also, you know, merge it.
Consider:
This is a valid Racket code in the
at-exp
notation. However,;
is treated as a comment marker, causing a bad syntax highlight and brace mismatches.