<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help with JSON and Scintilla Lexer]]></title><description><![CDATA[<p dir="auto">After getting frustrated with JSON highlighting comments red, I started poking around the lexer on github and found that there is a function in LexJSON.cxx to allow comments</p>
<pre><code>116
struct OptionSetJSON : public OptionSet&lt;OptionsJSON&gt; {
	OptionSetJSON() {
		DefineProperty("lexer.json.escape.sequence", &amp;OptionsJSON::escapeSequence,
					   "Set to 1 to enable highlighting of escape sequences in strings");

		DefineProperty("lexer.json.allow.comments", &amp;OptionsJSON::allowComments,
					   "Set to 1 to enable highlighting of line/block comments in JSON");

		DefineProperty("fold.compact", &amp;OptionsJSON::foldCompact);
		DefineProperty("fold", &amp;OptionsJSON::fold);
		DefineWordListSets(JSONWordListDesc);
	}
};
</code></pre>
<p dir="auto">Later it checks those settings</p>
<pre><code>389
			} else if (options.allowComments &amp;&amp; context.Match("/*")) {
				context.SetState(SCE_JSON_BLOCKCOMMENT);
				context.Forward();
			} else if (options.allowComments &amp;&amp; context.Match("//")) {
				context.SetState(SCE_JSON_LINECOMMENT);
</code></pre>
<p dir="auto">And yet, nowhere am I allowed to change allowComments.<br />
So my question is; Can I change this at all? For example, could I perhaps attach a shell and send a command that changes Lexer.json.allow.comments to 1? I’m just sick of looking at red highlights whenever there are comments in the JSON I open. I know that the JSON specifications technically exclude comments for many reasons, but many parsers check for comments and apparently those are the one’s I’m working with because there are almost always comments when I open a JSON file. Even Microsoft is using comments in their JSON. (For example, their new Terminal app has its settings stored in a JSON you have to edit yourself.)</p>
<p dir="auto">Any help would be appreciated.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19486/help-with-json-and-scintilla-lexer</link><generator>RSS for Node</generator><lastBuildDate>Fri, 12 Jun 2026 05:05:58 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19486.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Jun 2020 08:08:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Fri, 19 May 2023 14:07:51 GMT]]></title><description><![CDATA[<p dir="auto">For future readers:</p>
<p dir="auto">Approximately two years later, someone put in <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11713" rel="nofollow ugc">feature request #11713</a> to request this toggle.  (They also put in a separate request <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11676" rel="nofollow ugc">#11676</a> to add all the features of JSON5/JSONC, not just comments.)</p>
<p dir="auto"><em>update</em>: This request was implemented and released in v8.4.9 in January 2023 (see <a href="https://community.notepad-plus-plus.org/topic/24081/notepad-v8-4-9-release">release notes item 3</a>)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/80553</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/80553</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 19 May 2023 14:07:51 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 18:06:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/54508">Help with JSON and Scintilla Lexer</a>:</p>
<blockquote>
<p dir="auto">Good timing.  I just finished a script to explore this:</p>
</blockquote>
<p dir="auto">As the author of “PerlScript” why don’t you post Perl solutions ???    :-)</p>
<p dir="auto">Pretty quick but roughly Perl equivalent of the PythonScript you posted:</p>
<pre><code>#!perl

use strict;
use warnings;

use Win32::Mechanize::NotepadPlusPlus ':all';

my $keep = notepad-&gt;getLangType();

for my $t ( sort ( keys ( %LANGTYPE ) ) ) {
    my $n = notepad-&gt;getLanguageName($LANGTYPE{$t});
    my $d = notepad-&gt;getLanguageDesc($LANGTYPE{$t});
    printf "%-35s %-35s %-35s\n", $t, $n, $d;

    notepad-&gt;setLangType($LANGTYPE{$t});
    for my $s ( split "\n", editor-&gt;propertyNames() ) {
        my $v = editor-&gt;getProperty($s);
        printf "\t'%-32s' :%i: %-32s %s\n" , $s, editor-&gt;propertyType($s), '"' . $v . '"', editor-&gt;describeProperty($s);
    }
    print "\n";
}

notepad-&gt;setLangType($keep);
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/54514</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54514</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Mon, 01 Jun 2020 18:06:05 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 17:16:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tyree-bingham" aria-label="Profile: Tyree-Bingham">@<bdi>Tyree-Bingham</bdi></a> ,</p>
<p dir="auto">Sorry for hijacking your thread.  In the first few responses, we showed a few of the scripting-languages’ methods for changing that setting.  If you need more help, let us know which scripting language you chose, and where you’re having trouble.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54513</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54513</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 01 Jun 2020 17:16:45 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 17:15:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> said in <a href="/post/54510">Help with JSON and Scintilla Lexer</a>:</p>
<blockquote>
<p dir="auto">Something like <code>for t in LANGTYPE.values.values():</code></p>
</blockquote>
<p dir="auto">Yep.  Exactly that syntax worked for me.  Much cleaner – and now my saved script will still work in future versions with new LANGTYPEs. :-)</p>
<p dir="auto">Since the first worked, I didn’t bother with the <code>eval</code>, though that’s a good alternative.  Also, for parsing the <code>dir(...)</code> strings, I would have had to eliminate the various helper methods, too, which I don’t have to do with the <code>LANGTYPE.values.values()</code> syntax, so all-in-all, values were better. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54512</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54512</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 01 Jun 2020 17:15:21 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 17:04:28 GMT]]></title><description><![CDATA[<p dir="auto">By the way, what always works, but is banned by most of the python programmers<br />
is using eval function. So something like</p>
<pre><code class="language-py">eval('LANGTYPE.{}'.format('ADA'))
</code></pre>
<p dir="auto">will return the LANGTYPE.ADA object.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54511</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54511</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 01 Jun 2020 17:04:28 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 17:01:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<p dir="auto">oopss - I’m surprised to see that much info.<br />
Boost::python seems to create the classes with names and values attributes,<br />
which itself do return a dict and this can be iterated.<br />
Something like <code>for t in LANGTYPE.values.values():</code><br />
should do the job.<br />
The first values creates the dictionary(hash) and the second a list of LANGTYPE enum members.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54510</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54510</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 01 Jun 2020 17:01:14 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 16:45:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a>,</p>
<blockquote>
<p dir="auto">propagate their “properties” in this way. :-(</p>
</blockquote>
<p dir="auto">Good timing.  I just finished a script to explore this:</p>
<pre><code class="language-py"># encoding=utf-8
"""
!!!REQUIRES PythonScript 1.5.4 to avoid getLanguageDesc() bug!!!
"""
from Npp import *

console.show()
console.clear()

notepad.new()
keep = notepad.getLangType()

for t in [LANGTYPE.ADA, LANGTYPE.ASM, LANGTYPE.ASN1, LANGTYPE.ASP, LANGTYPE.AU3, LANGTYPE.AVS, LANGTYPE.BAANC, LANGTYPE.BASH, LANGTYPE.BATCH, LANGTYPE.BLITZBASIC, LANGTYPE.C, LANGTYPE.CAML, LANGTYPE.CMAKE, LANGTYPE.COBOL, LANGTYPE.COFFEESCRIPT, LANGTYPE.CPP, LANGTYPE.CS, LANGTYPE.CSOUND, LANGTYPE.CSS, LANGTYPE.D, LANGTYPE.DIFF, LANGTYPE.ERLANG, LANGTYPE.ESCRIPT, LANGTYPE.FLASH, LANGTYPE.FORTH, LANGTYPE.FORTRAN, LANGTYPE.FORTRAN_77, LANGTYPE.FREEBASIC, LANGTYPE.GUI4CLI, LANGTYPE.HASKELL, LANGTYPE.HTML, LANGTYPE.IHEX, LANGTYPE.INI, LANGTYPE.INNO, LANGTYPE.JAVA, LANGTYPE.JAVASCRIPT, LANGTYPE.JS, LANGTYPE.JSON, LANGTYPE.JSP, LANGTYPE.KIX, LANGTYPE.LATEX, LANGTYPE.LISP, LANGTYPE.LUA, LANGTYPE.MAKEFILE, LANGTYPE.MATLAB, LANGTYPE.MMIXAL, LANGTYPE.NIMROD, LANGTYPE.NNCRONTAB, LANGTYPE.NSIS, LANGTYPE.OBJC, LANGTYPE.OSCRIPT, LANGTYPE.PASCAL, LANGTYPE.PERL, LANGTYPE.PHP, LANGTYPE.POWERSHELL, LANGTYPE.PROPS, LANGTYPE.PS, LANGTYPE.PUREBASIC, LANGTYPE.PYTHON, LANGTYPE.R, LANGTYPE.RC, LANGTYPE.REBOL, LANGTYPE.REGISTRY, LANGTYPE.RUBY, LANGTYPE.RUST, LANGTYPE.SCHEME, LANGTYPE.SEARCHRESULT, LANGTYPE.SMALLTALK, LANGTYPE.SPICE, LANGTYPE.SQL, LANGTYPE.SREC, LANGTYPE.SWIFT, LANGTYPE.TCL, LANGTYPE.TEHEX, LANGTYPE.TEX, LANGTYPE.TXT, LANGTYPE.TXT2TAGS, LANGTYPE.USER, LANGTYPE.VB, LANGTYPE.VERILOG, LANGTYPE.VHDL, LANGTYPE.VISUALPROLOG, LANGTYPE.XML, LANGTYPE.YAML]:
    n = notepad.getLanguageName(t)
    d = notepad.getLanguageDesc(t)
    console.write("{!s:&lt;35.35s} {!s:&lt;35.35s}  {!s:&lt;35.35s}\n".format(t,n,d))

    notepad.setLangType(t)
    for s in editor.propertyNames().split():
        if editor.getPropertyInt(s,-65537) &gt; -65537:
            v = str(editor.getPropertyInt(s,-65537))
        else:
            v = '"' + editor.getProperty(s) + '"'
        console.write("\t{:&lt;32.32}:{:01d}: {:&lt;32.32} \"{}\"\n".format("'"+s+"'", editor.propertyType(s), v, editor.describeProperty(s)))

notepad.setLangType(keep)
notepad.close()
</code></pre>
<p dir="auto">-–<br />
Tangential: While I’ve got you here, <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> , I manually used <code>dir(LANGTYPE)</code> to get that list, then I changed <code>['ADA', ...]</code> to <code>[LANGTYPE.ADA, ...]</code>.  Is there an easier way to do that inside Python, rather than manually making the list of types?<br />
-–</p>
<p dir="auto">Anyway, back to the results: quite a few have properties, but not all:</p>
<pre><code class="language-txt">...
JAVASCRIPT                          JavaScript                           JavaScript file                    
	'styling.within.preprocessor'   :0: ""                               "For C++ code, determines whether all preprocessor code is styled in the preprocessor style (0, the default) or only from the initial # to the end of the command word(1)."
	'lexer.cpp.allow.dollars'       :0: ""                               "Set to 0 to disallow the '$' character in identifiers with the cpp lexer."
	'lexer.cpp.track.preprocessor'  :0: 0                                "Set to 1 to interpret #if/#else/#endif to grey out code that is not active."
	'lexer.cpp.update.preprocessor' :0: ""                               "Set to 1 to update preprocessor definitions when #define found."
	'lexer.cpp.verbatim.strings.allo:0: ""                               "Set to 1 to allow verbatim strings to contain escape sequences."
	'lexer.cpp.triplequoted.strings':0: ""                               "Set to 1 to enable highlighting of triple-quoted strings."
	'lexer.cpp.hashquoted.strings'  :0: ""                               "Set to 1 to enable highlighting of hash-quoted strings."
	'lexer.cpp.backquoted.strings'  :0: 1                                "Set to 1 to enable highlighting of back-quoted raw strings ."
	'lexer.cpp.escape.sequence'     :0: ""                               "Set to 1 to enable highlighting of escape sequences in strings"
	'fold'                          :0: 1                                ""
	'fold.cpp.syntax.based'         :0: ""                               "Set this property to 0 to disable syntax based folding."
	'fold.comment'                  :0: 1                                "This option enables folding multi-line comments and explicit fold points when using the C++ lexer. Explicit fold points allows adding extra folding by placing a //{ comment at the start and a //} at the end of a section that should fold."
	'fold.cpp.comment.multiline'    :0: ""                               "Set this property to 0 to disable folding multi-line comments when fold.comment=1."
	'fold.cpp.comment.explicit'     :0: ""                               "Set this property to 0 to disable folding explicit fold points when fold.comment=1."
	'fold.cpp.explicit.start'       :2: ""                               "The string to use for explicit fold start points, replacing the standard //{."
	'fold.cpp.explicit.end'         :2: ""                               "The string to use for explicit fold end points, replacing the standard //}."
	'fold.cpp.explicit.anywhere'    :0: ""                               "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."
	'fold.cpp.preprocessor.at.else' :0: ""                               "This option enables folding on a preprocessor #else or #endif line of an #if statement."
	'fold.preprocessor'             :0: 1                                "This option enables folding preprocessor directives when using the C++ lexer. Includes C#'s explicit #region and #endregion folding directives."
	'fold.compact'                  :0: 0                                ""
	'fold.at.else'                  :0: ""                               "This option enables C++ folding on a "} else {" line of an if statement."
JS                                  JavaScript                           JavaScript file                    
	'styling.within.preprocessor'   :0: ""                               "For C++ code, determines whether all preprocessor code is styled in the preprocessor style (0, the default) or only from the initial # to the end of the command word(1)."
	'lexer.cpp.allow.dollars'       :0: ""                               "Set to 0 to disallow the '$' character in identifiers with the cpp lexer."
	'lexer.cpp.track.preprocessor'  :0: 0                                "Set to 1 to interpret #if/#else/#endif to grey out code that is not active."
	'lexer.cpp.update.preprocessor' :0: ""                               "Set to 1 to update preprocessor definitions when #define found."
	'lexer.cpp.verbatim.strings.allo:0: ""                               "Set to 1 to allow verbatim strings to contain escape sequences."
	'lexer.cpp.triplequoted.strings':0: ""                               "Set to 1 to enable highlighting of triple-quoted strings."
	'lexer.cpp.hashquoted.strings'  :0: ""                               "Set to 1 to enable highlighting of hash-quoted strings."
	'lexer.cpp.backquoted.strings'  :0: 1                                "Set to 1 to enable highlighting of back-quoted raw strings ."
	'lexer.cpp.escape.sequence'     :0: ""                               "Set to 1 to enable highlighting of escape sequences in strings"
	'fold'                          :0: 1                                ""
	'fold.cpp.syntax.based'         :0: ""                               "Set this property to 0 to disable syntax based folding."
	'fold.comment'                  :0: 1                                "This option enables folding multi-line comments and explicit fold points when using the C++ lexer. Explicit fold points allows adding extra folding by placing a //{ comment at the start and a //} at the end of a section that should fold."
	'fold.cpp.comment.multiline'    :0: ""                               "Set this property to 0 to disable folding multi-line comments when fold.comment=1."
	'fold.cpp.comment.explicit'     :0: ""                               "Set this property to 0 to disable folding explicit fold points when fold.comment=1."
	'fold.cpp.explicit.start'       :2: ""                               "The string to use for explicit fold start points, replacing the standard //{."
	'fold.cpp.explicit.end'         :2: ""                               "The string to use for explicit fold end points, replacing the standard //}."
	'fold.cpp.explicit.anywhere'    :0: ""                               "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."
	'fold.cpp.preprocessor.at.else' :0: ""                               "This option enables folding on a preprocessor #else or #endif line of an #if statement."
	'fold.preprocessor'             :0: 1                                "This option enables folding preprocessor directives when using the C++ lexer. Includes C#'s explicit #region and #endregion folding directives."
	'fold.compact'                  :0: 0                                ""
	'fold.at.else'                  :0: ""                               "This option enables C++ folding on a "} else {" line of an if statement."
JSON                                json                                 JSON file                          
	'lexer.json.escape.sequence'    :0: ""                               "Set to 1 to enable highlighting of escape sequences in strings"
	'lexer.json.allow.comments'     :0: ""                               "Set to 1 to enable highlighting of line/block comments in JSON"
	'fold.compact'                  :0: 0                                ""
	'fold'                          :0: 1                                ""
...
PERL                                Perl                                 Perl source file                   
	'fold'                          :0: 1                                ""
	'fold.comment'                  :0: 1                                ""
	'fold.compact'                  :0: 0                                ""
	'fold.perl.pod'                 :0: ""                               "Set to 0 to disable folding Pod blocks when using the Perl lexer."
	'fold.perl.package'             :0: ""                               "Set to 0 to disable folding packages when using the Perl lexer."
	'fold.perl.comment.explicit'    :0: ""                               "Set to 0 to disable explicit folding."
	'fold.perl.at.else'             :0: ""                               "This option enables Perl folding on a "} else {" line of an if statement."
...
PYTHON                              Python                               Python file                        
	'tab.timmy.whinge.level'        :1: ""                               "For Python code, checks whether indenting is consistent. The default, 0 turns off indentation checking, 1 checks whether each line is potentially inconsistent with the previous line, 2 checks whether any space characters occur before a tab character in the indentation, 3 checks whether any spaces are in the indentation, and 4 checks for any tab characters in the indentation. 1 is a good level to use."
	'lexer.python.literals.binary'  :0: ""                               "Set to 0 to not recognise Python 3 binary and octal literals: 0b1011 0o712."
	'lexer.python.strings.u'        :0: ""                               "Set to 0 to not recognise Python Unicode literals u"x" as used before Python 3."
	'lexer.python.strings.b'        :0: ""                               "Set to 0 to not recognise Python 3 bytes literals b"x"."
	'lexer.python.strings.f'        :0: ""                               "Set to 0 to not recognise Python 3.6 f-string literals f"var={var}"."
	'lexer.python.strings.over.newli:0: ""                               "Set to 1 to allow strings to span newline characters."
	'lexer.python.keywords2.no.sub.i:0: ""                               "When enabled, it will not style keywords2 items that are used as a sub-identifier. Example: when set, will not highlight "foo.open" when "open" is a keywords2 item."
	'fold'                          :0: 1                                ""
	'fold.quotes.python'            :0: 1                                "This option enables folding multi-line quoted strings when using the Python lexer."
	'fold.compact'                  :0: 0                                ""
	'lexer.python.unicode.identifier:0: ""                               "Set to 0 to not recognise Python 3 unicode identifiers."
...
</code></pre>
<p dir="auto">(it was too long, so I pared down results</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54508</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54508</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 01 Jun 2020 16:45:39 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 16:33:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: Michael-Vincent">@<bdi>Michael-Vincent</bdi></a></p>
<p dir="auto">but don’t be sad if it turns out that very few lexers<br />
propagate their “properties” in this way. :-(</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54506</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54506</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 01 Jun 2020 16:33:54 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 16:17:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/54490">Help with JSON and Scintilla Lexer</a>:</p>
<blockquote>
<p dir="auto">The Scintilla interface has a way to set and get properties.</p>
</blockquote>
<p dir="auto">I got pretty excited about this:</p>
<pre><code>::lex
NPP_CONSOLE keep

SET LOCAL AFTER  = 0

IF "$(ARGC)"&lt;="1" THEN
    SCI_SENDMSG SCI_PROPERTYNAMES 0 @""
    ECHO $(MSG_LPARAM)
ELSE IF "$(ARGC)"&lt;="2" THEN
    SCI_SENDMSG SCI_DESCRIBEPROPERTY "$(ARGV[1])" @""
    ECHO $(MSG_LPARAM)
    SCI_SENDMSG SCI_GETPROPERTYEXPANDED "$(ARGV[1])" @""
    ECHO $(ARGV[1]) = $(MSG_LPARAM)
ELSE IF "$(ARGC)"&lt;="3" THEN
    SCI_SENDMSG SCI_SETPROPERTY "$(ARGV[1])" "$(ARGV[2])"
ELSE
    GOTO USAGE
ENDIF
GOTO END

:USAGE
ECHO Usage:
ECHO   \$(ARGV[0])         = current lexer properties
ECHO   \$(ARGV[0]) [K]     = get value of property K
ECHO   \$(ARGV[0]) [K] [V] = set property K to value V

:END
</code></pre>
<p dir="auto">Now I’ve been running <code>\lex</code> from <a href="https://github.com/d0vgan/nppexec" rel="nofollow ugc">NppExec</a> console on <strong>all</strong> filetypes to see what magical properties Scintilla has that I can monkey with :-)</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54503</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54503</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Mon, 01 Jun 2020 16:17:38 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 15:10:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/54490">Help with JSON and Scintilla Lexer</a>:</p>
<blockquote>
<p dir="auto">though I had to click back in the editor pane to get the screen to refresh</p>
</blockquote>
<p dir="auto">As did I with NppExec, thanks for mentioning that.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54491</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54491</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Mon, 01 Jun 2020 15:10:31 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 15:05:50 GMT]]></title><description><![CDATA[<p dir="auto">I mentioned,</p>
<blockquote>
<p dir="auto">scintilla properties</p>
</blockquote>
<p dir="auto">Yes, that worked – and as I was writing it up, <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: Michael-Vincent">@<bdi>Michael-Vincent</bdi></a> replied. :-)</p>
<p dir="auto">The Scintilla interface has a way to <a href="https://www.scintilla.org/ScintillaDoc.html#SCI_SETPROPERTY" rel="nofollow ugc">set and get properties</a>.  I was able to confirm that you can write that property: in <a href="https://github.com/bruderstein/PythonScript/" rel="nofollow ugc">PythonScript</a> (available through Plugins Admin), using <code>editor.setProperty("lexer.json.allow.comments",1)</code> will accomplish the same thing that Michael’s NppExec script did.</p>
<p dir="auto">If you have a perl interpreter, <a href="https://metacpan.org/pod/Win32::Mechanize::NotepadPlusPlus" rel="nofollow ugc">Win32::Mechanize::NotepadPlusPlus</a> will do the same with <code>editor-&gt;setProperty("lexer.json.allow.comments",1)</code> (though I had to click back in the editor pane to get the screen to refresh after Perl tried to update the property)</p>
<p dir="auto">Does <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> want to add per-language settings to the <a href="https://sourceforge.net/projects/extsettings/" rel="nofollow ugc">ExtSettings</a> plugin?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54490</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54490</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 01 Jun 2020 15:05:50 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Mon, 01 Jun 2020 14:54:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/54488">Help with JSON and Scintilla Lexer</a>:</p>
<blockquote>
<p dir="auto">PS: I had an idea that I want to experiment with – maybe it is possible to access, since it’s done with scintilla properties, but I’ve got to be away from the keyboard, so it might be a while before I get a chance to experiment.  One of the other regulars here might be able to take my “scintilla properties hint” and finish the experiment before I get back. :-)</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tyree-bingham" aria-label="Profile: Tyree-Bingham">@<bdi>Tyree-Bingham</bdi></a><br />
Pick your scripting plugin of choice - mine is <a href="https://github.com/d0vgan/nppexec" rel="nofollow ugc">NppExec</a>.</p>
<p dir="auto">Testing for JSON properties with an open JSON document:</p>
<pre><code>{
  "key1": "value1",
  "key2": 2,
  // comment
  "list1": [
    "keylist1": "keyvalue1"   
  ]
}
</code></pre>
<p dir="auto">which looks like (note I’m using the Obsidian theme so colors may vary, but the comment is red error text):</p>
<p dir="auto"><img src="/assets/uploads/files/1591022897582-5cb2217d-dd44-4acd-8127-97fbfdf47241-image.png" alt="5cb2217d-dd44-4acd-8127-97fbfdf47241-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I can use NppExec and get the following:</p>
<pre><code>================ READY ================
SCI_SENDMSG SCI_PROPERTYNAMES 0 @""
================ READY ================
echo $(MSG_LPARAM)
lexer.json.escape.sequence
lexer.json.allow.comments
fold.compact
fold
================ READY ================
</code></pre>
<p dir="auto">So the script to enable comments is (you’ll need to translate from this script to your scripting language preference (e.g., <a href="http://npppythonscript.sourceforge.net/" rel="nofollow ugc">PythonScript</a>, <a href="https://github.com/dail8859/LuaScript" rel="nofollow ugc">LuaScript</a>, “<a href="https://metacpan.org/pod/Win32::Mechanize::NotepadPlusPlus::Notepad" rel="nofollow ugc">PerlScript</a>”).</p>
<pre><code>SCI_SENDMSG SCI_SETPROPERTY "lexer.json.allow.comments" "1"
</code></pre>
<p dir="auto">Now I see:</p>
<p dir="auto"><img src="/assets/uploads/files/1591023196623-6a6aae80-72c4-430e-aaed-bfc0e33981a7-image.png" alt="6a6aae80-72c4-430e-aaed-bfc0e33981a7-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54489</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54489</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Mon, 01 Jun 2020 14:54:15 GMT</pubDate></item><item><title><![CDATA[Reply to Help with JSON and Scintilla Lexer on Thu, 12 Feb 2026 18:42:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tyree-bingham" aria-label="Profile: Tyree-Bingham">@<bdi>Tyree-Bingham</bdi></a> said in <a href="/post/54483">Help with JSON and Scintilla Lexer</a>:</p>
<blockquote>
<p dir="auto">could I perhaps attach a shell and send a command that changes Lexer.json.allow.comments to 1?</p>
</blockquote>
<p dir="auto">Interesting idea.  However, I think that Lexer.json’s <code>options.allowComments</code> is an internal variable that you cannot access from the outside world.  So I don’t think that would be possible from a scripting plugin or external “shell”.</p>
<p dir="auto">The best long-term solution would be to follow the <a href="https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report">FAQ</a> to see how to issue a feature request.  I know that the developer has previously done a language-specific option – the SQL backslash-as-escape option – on the <strong>Preferences &gt; Language</strong> menu:<br />
<img src="/assets/uploads/files/1591019138165-90d075a6-fc62-4dc6-8299-3108ae91cef4-image.png" alt="90d075a6-fc62-4dc6-8299-3108ae91cef4-image.png" class=" img-fluid img-markdown" /><br />
If you wanted to steal that image to embed in your feature request, and say something like</p>
<pre><code class="language-z">I would like to be able to allow comments in my JSON files; by default, the JSON lexer disables JSON comments, but line 389 of the JSON lexer source code shows there's an option `options.allowComments` in the lexer:

			} else if (options.allowComments &amp;&amp; context.Match("/*")) {
				context.SetState(SCE_JSON_BLOCKCOMMENT);
				context.Forward();
			} else if (options.allowComments &amp;&amp; context.Match("//")) {
				context.SetState(SCE_JSON_LINECOMMENT);

... and the Style Configurator has the LINECOMMENT and BLOCKCOMMENT styles, but those never take effect because the lexer option is turned off.  Would it be possible to add an option in the Notepad++ interface that would toggle that lexer option?  Maybe put it in **Preferences &gt; Language**, like for the SQL backslash-as-escape option: ![](https://community.notepad-plus-plus.org/assets/uploads/files/1591019138165-90d075a6-fc62-4dc6-8299-3108ae91cef4-image.png)
</code></pre>
<p dir="auto">Note: I wrote possible text for the issue for you because I think this is a good option to provide to all Notepad++ users.  A year ago, I would have actually submitted the issue for you, but I learned recently that the developer pays more attention to issues put in by “normal users” like you, so it would increase your chances if you put in the request yourself.  Feel free to rephrase to your own words</p>
<blockquote>
<p dir="auto">I’m just sick of looking at red highlights whenever there are comments in the JSON I open</p>
</blockquote>
<p dir="auto">As a workaround, you can add extra highlighting to a builtin lexer (like the JSON lexer) using regexes via the script <code>EnhanceAnyBuiltinLexer.py</code> that <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> shares <a href="https://community.notepad-plus-plus.org/topic/17283/perl-language-syntax-highlighting-troubles-bug-or-limitation/111">in this linked post</a>.  With that, you should be able to look for the comment sequence and set a new highlighting that would override the default error highlighting.</p>
<p dir="auto">-—<br />
<strong>PS</strong>: I had an idea that I want to experiment with – maybe it <em>is</em> possible to access, since it’s done with scintilla properties, but I’ve got to be away from the keyboard, so it might be a while before I get a chance to experiment.  One of the other regulars here might be able to take my “scintilla properties hint” and finish the experiment before I get back. :-)</p>
<hr />
<p dir="auto"><em>moderator: fixed link to match modern forum linking</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/54488</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54488</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 12 Feb 2026 18:42:51 GMT</pubDate></item></channel></rss>