<p>This commit changes JSON from a custom filetype to one with its own lexer, as requested in<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="50137933" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/384" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/384/hovercard?comment_id=583869454&comment_type=issue_comment" href="https://github.com/geany/geany/issues/384#issuecomment-583869454">#384 (comment)</a>. The lexer is taken from Scintilla's upstream<br>
(version 3.10.4).</p>
<p>This has the following effects:</p>
<ul>
<li>JavaScript comments (//, /* */) are no longer highlighted as comments, since JSON doesn't allow them</li>
<li>Text outside of quotes, except keywords and numbers, is now considered an error, and highlighted as such (in red)</li>
</ul>
<p>It should also allow keys and string values to be highlighted in different colours, as in many other editors, but I couldn't get that to work.</p>
<p>Stopping comments from being highlighted is the main motivation for this - highlighting them misleads the user into thinking that JSON allows them.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/2454'>https://github.com/geany/geany/pull/2454</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Use Scintilla's JSON lexer for JSON instead of the JavaScript/C++ lexer</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-c36bdf4f1650ffd3698554e9a363a8d1">data/Makefile.am</a>
    (2)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-5095c74c9c1748d660aaaaab469b3b31">data/filedefs/filetypes.JSON.conf</a>
    (17)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-5352363a9301b04ebb6148ac77bfbc26">data/filedefs/filetypes.json</a>
    (32)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-d6b2a750b4880b93a88bbc951034d96a">scintilla/Makefile.am</a>
    (1)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-1c3515ce8b1d35bd9311698f66296938">scintilla/lexers/LexJSON.cxx</a>
    (498)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-2d9bdcb12d8fb945ebd5f0e361af620b">scintilla/scintilla_changes.patch</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-2ff04a3b4e4769006c69d050c84f79f1">scintilla/src/Catalogue.cxx</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-5e9e792c79a5e2bcad777d890a9983ed">src/editor.c</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-61151cbfa2668c9ecc14194892bd535a">src/filetypes.c</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-56ac9f4466cfe0df698b8ddeabef0b48">src/filetypes.h</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-960a9038cd0e031796eb2ce2f0d22df9">src/highlighting.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2454/files#diff-8ac88807d212becda3d1e6da5b20d446">src/highlightingmappings.h</a>
    (25)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/2454.patch'>https://github.com/geany/geany/pull/2454.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/2454.diff'>https://github.com/geany/geany/pull/2454.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2454">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ6T7CKVLM34YACGRJTRH7WHJANCNFSM4LN4L75A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJYYXGX5WDLTCH7HWILRH7WHJA5CNFSM4LN4L75KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IWEYQQA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2454",
"url": "https://github.com/geany/geany/pull/2454",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>