Open skykanin opened 9 months ago
The grammar broke some stuff we were depending on, but I just pushed a commit doing at least some highlighting
I've discovered two separate issues:
Looking at different uiua functions using describe-char
I can see that some have the incorrect font face i.e. ⊏ select
and ↥ maximum
have the font face uiua-monadic-function
instead of uiua-dyadic-function
.
Furthermore these faces inherit the font-lock-builtin-face
and font-lock-variable-name-face
respectively as defined in uiua-mode.el
which usually don't have any theming hence uiua functions, whether monadic or dyadic, aren't highlighted at all
For the second one, I'd love it if you could suggest faces with better defaults. The first one is due to a change in how the grammar is labeling things, will have to look at the author's helix editor implementation of syntax highlighting using the grammar.
For the second one, I'd love it if you could suggest faces with better defaults.
These font lock face mappings seem more appropriate:
uiua-number
-> font-lock-number-face
uiua-noadic-or-constant
-> font-lock-constant-face
uiua-monadic-function
-> font-lock-function-name-face
uiua-dyadic-function
-> font-lock-type-face
or font-lock-doc-markup-face
uiua-monadic-modifier
-> font-lock-preprocessor-face
uiua-dyadic-modifier
-> font-lock-keyword-face
bqn-mode uses something similar although they don't distinguish between monadic and dyadic functions for syntax highlighting.
The mappings in the regular uiua-mode
would be the ones to change, no? The font locking here should still references those uiua-*
faces, but they could potentially inherit from different built-in faces, and the above suggestions look reasonable to me (apart from the "markup-face" one: better to stick with the core faces that existed long before Emacs 28).
However, IMO it's not super important to shuffle these default mapping because they're highly dependent on theming anyway.
What I did was update my fairly-popular tomorrow
themes so that the uiua-*
faces roughly match the theme in the online scratchpad.
The mappings in the regular
uiua-mode
would be the ones to change, no?
yes, exactly
Currently travelling, will look into integrating new changes to the grammar with the mode, but another theme with support for uiua faces is flexoki-themes by yours truly.
Even after setting up
uiua-ts-mode
and installing the language grammar resulting in.emacs.d/.local/cache/tree-sitter/libtree-sitter-uiua.so
functions aren't being highlighted properly. Following the example in theREADME.md
this is what I get:I would've expected functions like plus, length and divide to be highlighted. Other functions aren't highlighted either: