Community
    • Login

    More than eight keyword lists for User Defined Language?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 381 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      HydraheadHunter
      last edited by

      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 functions

      The 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)?

      Mark OlsonM 1 Reply Last reply Reply Quote 0
      • Mark OlsonM
        Mark Olson @HydraheadHunter
        last edited by

        @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

        H 2 Replies Last reply Reply Quote 1
        • H
          HydraheadHunter @Mark Olson
          last edited by

          @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?

          EkopalypseE 1 Reply Last reply Reply Quote 0
          • H
            HydraheadHunter @Mark Olson
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • EkopalypseE
              Ekopalypse @HydraheadHunter
              last edited by

              @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.

              1 Reply Last reply Reply Quote 2
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors