mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
feat(ruby): add injection for debugger command strings (#7480)
This commit is contained in:
parent
34d78baa86
commit
a295ba13d2
2 changed files with 23 additions and 0 deletions
|
|
@ -9,3 +9,15 @@
|
||||||
(regex
|
(regex
|
||||||
(string_content) @injection.content
|
(string_content) @injection.content
|
||||||
(#set! injection.language "regex"))
|
(#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))
|
||||||
|
|
|
||||||
11
tests/query/injections/ruby/test-ruby-debugger.rb
Normal file
11
tests/query/injections/ruby/test-ruby-debugger.rb
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue