-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Description of the Issue
Although comments are not officially supported in JSON files, many subsets of JSON allow comments.
According to notepad-plus-plus/userDefinedLanguages#58
and https://community.notepad-plus-plus.org/topic/19486/help-with-json-and-scintilla-lexer/2?lang=fr
Scintilla highlighting engine has a options.allowComments variable in the JSON lexer that would allow the highlight of comments. This option is not accessible from NPP. Also notice that the "Style configurator" has styles for "LINECOMMENT" and "BLOCKCOMMENT" for JSON files but these styles are not applied (because "allowComments" is set to false as default).
Could the "allowComments" option be added to Settings/Preferences/Languages screen in the same way that "Treat backslash as escape character for SQL" is an option on this screen ?
Steps to Reproduce the Issue
Create a new file, set Language to JSON and type
{
"myProperty": "any value" // this comment is treated as an error (red)
}
Expected Behavior
{
"myProperty": "any value" // this comment should be treated as a comment if "allowComments" option is set
}
Actual Behavior
Line comments and block comments are treated as errors.
Debug Information
not applicable (request feature)