Skip to content

fix(queries:ecma): proper numeric values#15642

Merged
the-mikedavis merged 1 commit intohelix-editor:masterfrom
Rudxain:fix-q-ecma-num
Apr 20, 2026
Merged

fix(queries:ecma): proper numeric values#15642
the-mikedavis merged 1 commit intohelix-editor:masterfrom
Rudxain:fix-q-ecma-num

Conversation

@Rudxain
Copy link
Copy Markdown
Contributor

@Rudxain Rudxain commented Apr 15, 2026

#15283 reopened, because the TS org is taking too long.


Unlike the previous PR, I decided to use smaller regexes that assume literals are valid. This makes them much more readable, at the expense of false positives (and a bit of false negatives).

Now everything is float unless it's clearly a bigint


To test, create a buffer with content:

1 // float
0x1e1n // int
1e1m // float then var (grammar err, should be float)
1e1n // float then var (grammar err, should be num)
0x1e1m // float then var (grammar err, should be num or float)
1e-1 // float
1e-0 // float
1e0 // float
0x1e-1 // 2 individual floats

and use the zenburn theme, as that theme is the only one that distinguishes the 3 cases by default

@Rudxain Rudxain force-pushed the fix-q-ecma-num branch 3 times, most recently from e724701 to a38a19c Compare April 15, 2026 10:39
@Rudxain Rudxain marked this pull request as ready for review April 15, 2026 10:43
@Rudxain Rudxain marked this pull request as draft April 15, 2026 11:20
@Rudxain Rudxain marked this pull request as ready for review April 15, 2026 11:23
@the-mikedavis the-mikedavis merged commit 27898f3 into helix-editor:master Apr 20, 2026
7 checks passed
@Rudxain Rudxain deleted the fix-q-ecma-num branch April 20, 2026 20:51
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.

2 participants