syntax/json: Add comment support to the syntax highlighting#3434
Merged
JoeKar merged 2 commits intomicro-editor:masterfrom Aug 19, 2024
Merged
syntax/json: Add comment support to the syntax highlighting#3434JoeKar merged 2 commits intomicro-editor:masterfrom
JoeKar merged 2 commits intomicro-editor:masterfrom
Conversation
dmaluka
approved these changes
Aug 19, 2024
Member
Author
|
Adding For now we keep the PR as is and maybe consider the rest afterwards. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
microalready usesjson5to parse his own internaljsonconfigurations and we changed the default behavior of thecommentplugin to set//as the default comment type withinjsonvia #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 withmicroinjson, because he/she should know if the file is parsed with ajson5parser or not.Especially since #3343 it's much more easy to edit
micro's own configurations inmicroitself by justreloading the changed files. As long asset,reset,bindandunbind(hopefully I didn't forget anything) isn't usedmicrodoesn't rewrite the settings by his own and the comments are kept.Additionally we can think about adding
hjson(#2203) andjsonc(#2704) to the samejsonsyntax definition, instead of creating new file types. The latter one is arguable, since via syntax includes it's also easy to extend/override definitions.