We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0805bc8 commit a38a19cCopy full SHA for a38a19c
1 file changed
runtime/queries/ecma/highlights.scm
@@ -241,7 +241,22 @@
241
(escape_sequence) @constant.character.escape
242
243
(regex) @string.regexp
244
-(number) @constant.numeric.integer
+
245
+; future-proof fall-back, and `TypedArray` values (looks like float, but is int)
246
+(number) @constant.numeric
247
+; https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#prod-NumericLiteral
248
+((number) @constant.numeric.float
249
+ (#match? @constant.numeric.float
250
+ ; `1.` isn't considered float,
251
+ ; for the same reason as `1e0`,
252
+ ; however `1.0` is float, which feels inconsistent
253
+ "([.]|([eE]-)).*[^n]$"
254
+ ))
255
+((number) @constant.numeric.integer
256
+ (#match? @constant.numeric.integer
257
+ "^[^+.][^.\-]*n$"
258
259
260
261
; Special identifiers
262
;--------------------
0 commit comments