Community
    • Login

    Language association with .jbeam files at JSON5

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    language association
    3 Posts 2 Posters 400 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.
    • UDGU
      UDG
      last edited by UDG

      I have tried everything I could find to make this association but the Style Configurator doesn’t have JSON5, I added “jbeam” to JSON5 in “langs.model.xml” and that didn’t work, and I cant find JSON5 in the theme files. This is everything I could think to do and none of it has worked. Help wanted.

      debug info

      Notepad++ v8.6.5   (64-bit)
      Build time : Mar 29 2024 - 17:04:43
      Path : D:\Program Files\Notepad++\notepad++.exe
      Command Line : 
      Admin mode : ON
      Local Conf mode : OFF
      Cloud Config : OFF
      Periodic Backup : ON
      OS Name : Windows 10 Pro (64-bit
      OS Version : 22H2
      OS Build : 19045.4170
      Current ANSI codepage : 1252
      Plugins : 
          ComparePlus (1.1)
          mimeTools (3.1)
          NppConverter (4.6)
          NppExport (0.4)
      
      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @UDG
        last edited by PeterJones

        @UDG ,

        JSON5 was done slightly differently than some languages. It uses all the styles from the JSON in the Style Configurator, but uses its defined extensions. Most of the time, if two langages use similar structure, they refer to the same underlying lexer, but they have a separate entry in the Style Configurator. But JSON5 does not. And because it’s not in Style Configurator, you cannot use the “user ext” box that you can for most built-in languages, which is admittedly annoying.

        I added “jbeam” to JSON5 in “langs.model.xml”

        That was almost right, but Notepad++ only reads the .model. version if it needs to re-create the langs.xml (like if you deleted it). If you want it to apply to the active langs file, you need edit %AppData%\Notepad++\langs.xml 🛈, then save and restart Notepad++.

        Note: if you had the .jbeam file open before you made that change, you will have to close the file and re-open it, because Notepad++ stores the chosen filetype in the session file, so even after exiting Notepad++ and restarting, it remembered the old “choice” (or automatic setting) for the .jbeam file. Ctrl+W, Ctrl+Shift+T.

        After I’ve made that change to langs.xml, then when I open a .jbeam file, it shows it with JSON5 highlighting, including allowing comments, and shows that it’s using the JSON5 lexer in the status bar.

        UDGU 1 Reply Last reply Reply Quote 1
        • UDGU
          UDG @PeterJones
          last edited by UDG

          @PeterJones
          You are an absolute life (and time) saver, thank you so much for the help.
          I edited langs.xml and that did it.

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