29 Commits

Author SHA1 Message Date
stefan
cc12e37e5b fix(nix): make all bash injections combined 2026-01-29 10:41:43 +01:00
Marc Jakobi
7efc1b58a8 fix(nix): refactor nixosTest injections for better performance (#8378) 2025-12-29 16:47:03 +01:00
Marc Jakobi
7ba26e7685 perf(nix): replace match with lua-match 2025-12-26 22:13:05 +01:00
Lev Velykoivanenko
c53bb10a71 fix(python): regex injection not working for concatenated strings (#8197)
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-10-26 09:25:42 -07:00
Christian Clason
cbfe8a20c7 feat(html): use gsub for mimetype lookup 2025-05-12 18:43:40 +02:00
Christian Clason
c17de56890 feat!: track parser revision in Lua
Problem: Tracking parser revision in lockfile and allowing override
through the parsers module complicates the code. In addition, only
revision changes are handled robustly, not changes to other installation
info.

Solution: Track parser revision in the parsers module directly. Reload
parser table on every install or update call. Support modifying parser
table in a `User TSUpdate` autocommand.
2025-05-12 18:43:40 +02:00
Marc Jakobi
628d5e442c injections(nix): add nixosTest.testScript + home-manager nvim config
(+ add Check to mkDerivation bash matches)

(+ add Check to mkDerivation bash matches)
2025-05-12 18:43:40 +02:00
Mikkel Mondrup Kristensen
0e21ee8df6 More bash injection support for Taskfile (#7805) 2025-04-07 21:08:22 +02:00
Anthony Fiddes
205faba176 feat(yaml): inject bash for taskfiles (#7804) 2025-04-06 19:09:27 +02:00
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
Derek Stride
a295ba13d2 feat(ruby): add injection for debugger command strings (#7480) 2024-12-30 11:14:03 +01:00
Riley Bruins
2d5c122af9 feat(http): more comprehensive highlights 2024-11-22 08:56:14 +01:00
Riley Bruins
7cec6219c4 fix(query): properly apply predicate injections
I think these have been broken since the query parser update. Basically
the inner node for the string content was preventing injections because
include-children was not set.
2024-07-27 17:17:26 +02:00
Christian Clason
10dd49958c chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
Pham Huy Hoang
80f66cdef1 injections(vue): inject typescript instead of js (#5577)
Interpolations (`{{valid js code}}`) and directive attributes
(`<element :directive="valid js code"`) can also be typescript code,
hence we can inject typescript instead of javascript here and still
be ok with highlights (bar some syntax differences between ts and js)
2023-11-06 11:04:13 +09:00
Christian Segundo
dac6efbaff fix(dockerfile): bash injection on run instructions 2023-09-17 16:32:21 +02:00
Christian Segundo
831dbb619e fix(yaml): promql injections block 2023-09-15 12:53:44 +02:00
Michael Hoffmann
b64ea2ec44 feat(promql,yaml): add parser and yaml injections
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
2023-07-18 03:03:11 -04:00
Lucario387
c7b9f68d03 feat(vue): add tsx/jsx injection queries (#4550)
* feat(vue): add tsx/jsx injection queries

- add a test

- style: format vue/injections.scm
2023-03-24 14:38:19 +00:00
Benny Powers
972da989bc test: ecma injections 2023-03-22 02:28:21 -04:00
Benny Powers
d228b51cd7 test: html injections 2023-03-22 02:28:21 -04:00
Pham Huy Hoang
d11dd552db injections(html): fix faulty css/js injections
Group queries to reduce duplicate injection tree

use only regex
2023-03-05 22:34:41 +02:00
lucario387
85d9534491 allow negative assertion in injection tests (#4107)
* tests(vue, svelte): strengthen tests

* fix(html, vue, svelte): fix wrong test format

* allow negative assertions in injection tests
2023-01-07 11:22:20 +01:00
Lucario387
28baed7698 refactor(svelte): Remove duplicated queries
These injection queries are defined already in html_tags, remove them

Signed-off-by: Pham Huy Hoang <hoangtun0810@gmail.com>
2023-01-03 12:05:10 +01:00
Lucario387
6f4b9b190b refactor(vue, html): Update injections
Update html_tags injections so that html/vue/svelte parsers can use
it without having a script/style tag being captured twice

Signed-off-by: Pham Huy Hoang <hoangtun0810@gmail.com>
2023-01-03 12:05:10 +01:00
Lucario387
f5d517f4a7 Fix(vue): Invalid match queries 2022-12-25 17:43:25 +01:00
Lucario387
bbd7ecb25d add test file 2022-12-25 14:58:33 +01:00
Stephan Seitz
881cb5b8f2 ci(injection tests): don't consider root language an injection 2021-12-20 18:16:45 +01:00
Stephan Seitz
a3862c9802 ci: add injection tests 2021-12-20 18:16:45 +01:00