feat(ruby): add injection for debugger command strings (#7480)

This commit is contained in:
Derek Stride 2024-12-30 05:14:03 -05:00 committed by GitHub
parent 34d78baa86
commit a295ba13d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View file

@ -9,3 +9,15 @@
(regex
(string_content) @injection.content
(#set! injection.language "regex"))
((call
receiver: (identifier) @_receiver
method: (identifier) @_method
arguments: (argument_list
(pair
key: (hash_key_symbol)
value: (string
(string_content) @injection.content))))
(#eq? @_receiver "binding")
(#any-of? @_method "b" "break")
(#set! injection.self))

View file

@ -0,0 +1,11 @@
binding.b(do: "puts 'Hello, world!'")
# ^ @ruby
binding.b(pre: "pp [1, 2, 3]")
# ^ @ruby
binding.break(do: "puts 'Hello, world!'")
# ^ @ruby
binding.break(pre: "pp [1, 2, 3]")
# ^ @ruby