More than eight keyword lists for User Defined Language?
-
I’m doing minecraft datapack work, and… mcfunction is, let’s generously call it a messy language. Anyway, kvetching aside, I want my UDL to highlight
*Canon Functions Names (eg function, give, execute, say)
*Common Function Modifiers (get, set, add, run)
*Uncommon Function Modifiers (destroy, outline, poi)
*Targets (@ a | e | p | s | r)
*Attributes ( tag, type, name)
*Anything in the “minecraft:” domain*My pack’s scoreboard objectives (variable names)
*My pack’s tags
*My pack’s functionsThe User defined language UI allows for eight keyword lists. I want nine categories of keyword. Eight is less than nine.
Is there a way to make eight bigger than nine, or am I gonna have to merge bight a bullet and merge two of my keywords list categories (probably, common and uncommon function modifiers)?
-
@HydraheadHunter
The EnhanceAnyLexer plugin can add (AFAIK) any number of styles to a lexer, so you could just use a regex (say,get|set|add|run
for Common Function Modifiers) to specify the keywords that aren’t covered by the UDL -
@Mark-Olson While this quite similar to what I want out of the box, it’s not behaving exactly like an idea solution for me.
Currently it only highlights words when I make an edit to the config file, and it stops highlighting them the moment I click off. Sorry if this seems a daft question, but is there a way to fix that?
-
@Mark-Olson Sorry for the double ping, I don’t know what I changed when futzing about, but it’s working now… I love technology.
Thank you so much for your help.
-
@HydraheadHunter said in More than eight keyword lists for User Defined Language?:
Currently it only highlights words when I make an edit to the config file
This is a kind of “live preview function” that makes it easier for users to see whether a particular regex is doing what it is supposed to do. It also gives hints if a regex is wrong or if there are overlaps with the actual lexer.
As soon as you save and close the ini file, the regex rule is also applied to the configured buffers. If you think something is not working as expected, feel free to report a bug here.