syntax/json: Add comment support to the syntax highlighting #3434
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This feature already has a quite long story:
Since
micro
already usesjson5
to parse his own internaljson
configurations and we changed the default behavior of thecomment
plugin to set//
as the default comment type withinjson
via #3388 it's just a logical step to highlight it correctly injson
's (reused #2736). It was and it will be up to the user if he/she places comments withmicro
injson
, because he/she should know if the file is parsed with ajson5
parser or not.Especially since #3343 it's much more easy to edit
micro
's own configurations inmicro
itself by justreload
ing the changed files. As long asset
,reset
,bind
andunbind
(hopefully I didn't forget anything) isn't usedmicro
doesn't rewrite the settings by his own and the comments are kept.Additionally we can think about adding
hjson
(#2203) andjsonc
(#2704) to the samejson
syntax definition, instead of creating new file types. The latter one is arguable, since via syntax includes it's also easy to extend/override definitions.