cpinitiative / ide

A realtime collaborative IDE with code execution, intellisense, mobile support, and built-in USACO submissions.
https://ide.usaco.guide/
Mozilla Public License 2.0
372 stars 36 forks source link

Some reserved words not highlighting java #91

Open Usernametaken12 opened 1 year ago

Usernametaken12 commented 1 year ago

"null" does not change color in the ide, despite being a reserved literal value in java. For the sake of completeness, "_", another reserved keyword, while not important in any way, does not change color. All other obscure keywords seem to work as intended, though.

thecodingwizard commented 1 year ago

This seems to be the default behavior of Monaco: https://microsoft.github.io/monaco-editor/monarch.html

I don't know why that is the case. It probably isn't too hard to explicitly mark null as a keyword for Java though (PR's welcome!)

vedant-z commented 1 year ago

Hi @thecodingwizard I would like to solve this one. Just need some hint if possible.

thecodingwizard commented 1 year ago

@vedant-z thanks! The monaco editor is created here: https://github.com/cpinitiative/ide/blob/96bcc706650c0b47f74b03e4a8a61624129cc7d0/src/components/MonacoEditor/MonacoEditor.tsx#L34 I am guessing that would be where you would want to make your changes.