<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nvim-treesitter/tests/query/highlights/promql, branch fix/lua</title>
<subtitle>[no description]</subtitle>
<id>http://git.sudomsg.com/mirror/nvim-treesitter/atom/tests/query/highlights/promql?h=fix%2Flua</id>
<link rel='self' href='http://git.sudomsg.com/mirror/nvim-treesitter/atom/tests/query/highlights/promql?h=fix%2Flua'/>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/'/>
<updated>2025-02-20T11:17:32Z</updated>
<entry>
<title>feat(promql): do not use regex for string labels (#7669)</title>
<updated>2025-02-20T11:17:32Z</updated>
<author>
<name>Daniil Leontev</name>
<email>d@leontiev.xyz</email>
</author>
<published>2025-02-20T11:17:32Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=d2ff4006418750aa8b91f280e66bdb623c891c95'/>
<id>urn:sha1:d2ff4006418750aa8b91f280e66bdb623c891c95</id>
<content type='text'>
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.
</content>
</entry>
</feed>
