Skip to content

Permissive int and float syntax highlighting#1230

Merged
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:dont-syntax-highlight-timestamps
Apr 16, 2026
Merged

Permissive int and float syntax highlighting#1230
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:dont-syntax-highlight-timestamps

Conversation

@datho7561
Copy link
Copy Markdown
Contributor

@datho7561 datho7561 commented Apr 10, 2026

What does this PR do?

  • Clean up the regex used to syntax highlight integers, booleans, and floats
  • Permit integers beginning with one or multiple 0s
  • Broke syntax highlighting of << fixed
  • << is syntax highlighted as an operator instead of having no scope (this means it changes in some themes, such as Monokai)

What issues does this PR fix or reference?

#1190, #1225

Is it tested? How?

Manually

@datho7561 datho7561 changed the title [WIP] Permissing int and float syntax highlighting [WIP] Permissive int and float syntax highlighting Apr 10, 2026
@datho7561 datho7561 force-pushed the dont-syntax-highlight-timestamps branch from 2f7b9e3 to 02f4399 Compare April 16, 2026 14:47
@datho7561 datho7561 marked this pull request as ready for review April 16, 2026 14:55
- Clean up the regex used to syntax highlight integers, booleans, and
  floats
- Permit integers beginning with one or multiple `0`s
- `<<` is syntax highlighted as an operator instead of having no scope (this means it changes in some themes, such as Monokai)

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 force-pushed the dont-syntax-highlight-timestamps branch from 02f4399 to ddf5215 Compare April 16, 2026 14:56
@datho7561 datho7561 changed the title [WIP] Permissive int and float syntax highlighting Permissive int and float syntax highlighting Apr 16, 2026
@datho7561
Copy link
Copy Markdown
Contributor Author

To try this out, switch to one of the default themes (eg. Dark (Visual Studio) or Dark 2026), then play around with this YAML file before and after:

myList:
  - 0001
  - 0002
  - 0003
  - 0004
  - 0005
  - 08
  - 09
  - "pantaloons"
otherValue:
  value: [0001, 0002, 00003, 0004, 0005, 0006, 0007, 0008, 0009, 08, 8, "pantpantpant"]
  array:
    - [001, 002, 03, 04, 05, 06, 07, 08, 09]
    - 2010-06-15T00:00:00
prop:
- 1
- .5
- 1.5
- 1..5
- ..5
- ..
- .
- 1.5.1
prop2: [1, .5, 1.5, 1..5, ..5, .., .]
prop3: null
prop4:
  - 55:55:55
  - 55:55:55.99
prop5: <<
prop6:
  - <<
prop7: [<<, 1.2, 1.3, 1.8, 1.9]

@datho7561
Copy link
Copy Markdown
Contributor Author

Root cause of test failures: microsoft/vscode-test#332

Copy link
Copy Markdown
Member

@shin19991207 shin19991207 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and works well from my manual testing. Thanks, David!

@datho7561 datho7561 merged commit 55ca5c6 into redhat-developer:main Apr 16, 2026
0 of 15 checks passed
@datho7561 datho7561 deleted the dont-syntax-highlight-timestamps branch April 16, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The color of the digits after the decimal point is incorrect Integers with leading zeros displaying as strings

2 participants