Language association with .jbeam files at JSON5
-
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)
-
@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 thelangs.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. -
@PeterJones
You are an absolute life (and time) saver, thank you so much for the help.
I edited langs.xml and that did it.