Add JSON Comment support - #1112
Open
DavidBerg-MSFT wants to merge 1 commit into
Open
Conversation
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.
First attempt at basic JSON comment support. Currently only supports
//and not/*also causes problems with existing unquoted scalars (likehttps://my.org), which I intend to fix, but I wanted to post what I have so far and get your feedback, so I can incorporate into future updates.See Yaml.Org Issue 196 for relevant discussion on how best to address the unquoted scalar issue (also YamlDotNet issue 1052).
Mode Switch
Currently governed by a
Scanner.JsonCommentsbool property to turn on/off. This works for testing, but probably not ideal for plumbing all the way up. Preferences welcome.Unit Tests
I added clones of the existing comment unit tests, but clearly additional tests will be necessary to handle the edge cases (see Yaml.Org Issue 196).
I'm seeing failures in the ConformsWithYamlSpec tests, "System.InvalidOperationException : No data found for YamlDotNet.Test.Spec.ParserSpecTests.ConformsWithYamlSpec". Those failures are occurring with and without my changes, so I'm ignoring them for now; however, if there's something I can do to make those tests work, please let me know.
Other
I'm generally trying to follow the contribution guidelines, if I missed anything, please let me know.