crmsnbleyd / uiua-ts-mode

Emacs major mode for Uiua, a stack-based array language, powered by tree-sitter
GNU General Public License v3.0
5 stars 1 forks source link

[Bug] uiua functions not being syntax highlighted #5

Open skykanin opened 9 months ago

skykanin commented 9 months ago

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 the README.md this is what I get: image

I would've expected functions like plus, length and divide to be highlighted. Other functions aren't highlighted either:

image image

crmsnbleyd commented 9 months ago

The grammar broke some stuff we were depending on, but I just pushed a commit doing at least some highlighting

skykanin commented 9 months ago

I've discovered two separate issues:

crmsnbleyd commented 9 months ago

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.

skykanin commented 9 months ago

For the second one, I'd love it if you could suggest faces with better defaults.

These font lock face mappings seem more appropriate:

bqn-mode uses something similar although they don't distinguish between monadic and dyadic functions for syntax highlighting.

purcell commented 9 months ago

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.

skykanin commented 9 months ago

The mappings in the regular uiua-mode would be the ones to change, no?

yes, exactly

crmsnbleyd commented 9 months ago

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.