SlickEdit Community
SlickEdit Product Discussion => SlickEdit® => Topic started by: brebey on January 08, 2020, 09:45:27 PM
-
I want to add "//" as a line-comment indicator in JSON files (*.json), and in other kinds of files, as well.
How do I make SlickEdit recognize "//" as a line-comment indicator in a JSON file so that it will properly color-code the comment lines?
-
Type the following on the SlickEdit command line:
help Color Coding::creating support for a new language
This help item has a lot of how to's including one for adding a line comment
-
Perfect! Up and going in 2 minutes. Very impressive Help detail - kudos, SlickEdit!
-
as an FYI, comments in JSON make it invalid. There are no comments in JSON by design.
-
Yes, I understand that about JSON not having "real" comments; thanks, though, for making the point. I pre-process my JSON files before deserialization to remove the comments. They are extremely useful for documenting configuration data, though, so it's worth the extra little step of stripping comments in-memory before deserialization.
-
I actually do it as well :) As long as you know it makes it invalid and are aware, its all good. Its easy to think its just javacsript and add comments without knowing about it and then wonder why something is broken somewhere.