Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix JSON highlighting #418

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ltrzesniewski
Copy link
Contributor

@ltrzesniewski ltrzesniewski commented Dec 17, 2023

While doing icsharpcode/ILSpy#3138 I noticed the JSON highlighting was wrong (see the last 2 lines in the screenshot), so this PR fixes that.

EDIT: I noticed there's an issue for this, so this fixes #410.

Here's the difference for the following example:

{
    "String": "Value",
    "Bool": true,
    "Null": null,
    "Number:": -42e10,
    "Object": {
        "Foo:": "Bar",
        "Multiline Key"
            :
            "Value"
    },
    "Array": ["Foo", "Bar", "Baz"]
}

Before:

image

After:

image

The rule for numbers adds support for - and reformats the regex.

I also kept the existing single-quoted strings and hex numbers which are not part of the JSON spec.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Json.xshd fix
1 participant