Skip to content

Incorrect range with quoted string values #605

@seanyeh

Description

@seanyeh

The range information for quoted string values somehow ignores the quotes when calculating range

might be related to #237

Example

values:
  x: a
  y: "a"

Exprs:

{
    "exprs": {
        "x": {
            "range": {
                "environment": "\u003cproject\u003e/\u003cyaml\u003e",
                "begin": {
                    "line": 2,
                    "column": 6,
                    "byte": 13
                },
                "end": {
                    "line": 2,
                    "column": 7,
                    "byte": 14
                }
            },
            "schema": {
                "type": "string",
                "const": "a"
            },
            "literal": "a"
        },
        "y": {
            "range": {
                "environment": "\u003cproject\u003e/\u003cyaml\u003e",
                "begin": {
                    "line": 3,
                    "column": 6,
                    "byte": 20
                },
                "end": {
                    "line": 3,
                    "column": 7,
                    "byte": 21
                }
            },
            "schema": {
                "type": "string",
                "const": "a"
            },
            "literal": "a"
        }
    },

See that for both x and y, the range end is { line: 3, column: 7 }. But y's range end should be { line: 3, column: 9 }

I also have confirmed that the range also gets off with escaped characters (since the backslash is ignored from the range)

Metadata

Metadata

Assignees

Labels

kind/bugSome behavior is incorrect or out of spec

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions