nvim-treesitter/tests/query/injections
Daniil Leontev d2ff400641
feat(promql): do not use regex for string labels (#7669)
In Prometheus, label values are treated as strings when used with the
`=` and `!=` operators, and as regular expressions when used with the
`=~` and `!~` operators.

Injecting and then highlighting all label values as regex leads to a
situation where entirely valid **string** label values containing regex
special characters are mistakenly parsed and highlighted as regex. This
results in syntax errors, causing labels to be highlighted incorrectly.

For example, in `foo{bar=~"[a-z]{1,3}"}`, `{` and `}` are regex special
characters, so regex highlighting is expected. However, in
`foo{path="/foo/{id}"}`, `{` and `}` are just part of the string and
have no special meaning, so the whole value should be highlighted as a
string.
2025-02-20 12:17:32 +01:00
..
cuda chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
dockerfile chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
ecma chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
html chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
http feat(http): more comprehensive highlights 2024-11-22 08:56:14 +01:00
promql feat(promql): do not use regex for string labels (#7669) 2025-02-20 12:17:32 +01:00
query fix(query): properly apply predicate injections 2024-07-27 17:17:26 +02:00
ruby feat(ruby): add injection for debugger command strings (#7480) 2024-12-30 11:14:03 +01:00
svelte chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
vue chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
yaml feat(promql): do not use regex for string labels (#7669) 2025-02-20 12:17:32 +01:00