[Github-comments] [geany/geany] Use Scintilla's JSON lexer for JSON instead of the JavaScript/C++ lexer (#2454)

elextr notifications at xxxxx
Sat May 16 11:42:40 UTC 2020


The JSON lexer setting is global for the filetype, so there would need to be two filetypes to handle both commentable JSON and uncommentable JSON.  Changing a filetype setting during editing is simply not usable.  But AFAIK there is nothing to distinguish between the variants so different filetypes can be selected. The whole file would have to be searched for comments before it was distinguished if it the file is a JSON with comments or a JSON without comments.

And then just because a file has no comments when opened doesn't say the user doesn't want to add them if the tool they are feeding the JSON to allows, and Geany doesn't know that tool.

As a general principle the highlighting lexer and even the tags parser are not meant to be syntax checkers, they should be as inclusive as possible unless its possible to distinguish which variant is intended.  For example the C++ lexer and parser don't distinguish if the file is C++98 or C++20 nor the C lexer/parser C89 to C21.

But the use the specific JSON lexer is still useful if it has other benefits, but it should be more inclusive by default, not less.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2454#issuecomment-629632719
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20200516/81843ebe/attachment.htm>


More information about the Github-comments mailing list