Skip to content

Don't syntax highlight 1.4.0 as a float#1182

Merged
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:901-float-syntax-highlighting
Dec 12, 2025
Merged

Don't syntax highlight 1.4.0 as a float#1182
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:901-float-syntax-highlighting

Conversation

@datho7561
Copy link
Contributor

What does this PR do?

Modify the TextMate grammar so that it doesn't count 1.4.0 as a floating point number. The current regular expression was taken from the YAML 1.1 spec, but the regular expression contradicts the examples and explanation and was likely an error. The new regular expression was taken from the YAML 1.2.2 spec. Notably, I believe that 1.4.0 is treated as a string in 1.1 and 1.2 YAML deserializers.

It doesn't seem like we'll be able to upstream this change into TextMate, given there's an existing upstream PR to make this change that hasn't been merged.

What issues does this PR fix or reference?

Fixes #901

Is it tested? How?

Manually, by creating and opening the file in the referenced issue. 23.200 should be highlighted as a float, and 1.4.0 should be highlighted as a string.

Modify the TextMate grammar so that it doesn't count `1.4.0` as a floating point number.
The current regular expression was taken from the YAML 1.1 spec,
but the regular expression contradicts the examples and explanation and
was likely an error.
The new regular expression was taken from the YAML 1.2.2 spec.
Notably, I believe that `1.4.0` is treated as a string in 1.1 and 1.2 YAML deserializers.

It doesn't seem like we'll be able to upstream this change into TextMate,
given there's an existing upstream PR to make this change that hasn't been
merged.

Fixes redhat-developer#901

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561
Copy link
Contributor Author

@CanePlayz if you are able to, do you mind testing this PR? If not, maybe I'll just merge.

@datho7561 datho7561 added this to the 1.20.0 milestone Dec 12, 2025
@datho7561 datho7561 added the bug label Dec 12, 2025
@datho7561 datho7561 merged commit 619d427 into redhat-developer:main Dec 12, 2025
2 of 3 checks passed
@datho7561 datho7561 deleted the 901-float-syntax-highlighting branch December 12, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent syntax highlighting

1 participant