diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-03 05:35:20 -0500 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-04 11:32:25 -0500 |
| commit | 25f99a270ac94afd7a4adc8c2055d33ec60125ab (patch) | |
| tree | 4e5d767f31ed40cb098ea575d11fd6c7f1fa82e9 /queries/lua | |
| parent | feat: add luap (diff) | |
| download | nvim-treesitter-25f99a270ac94afd7a4adc8c2055d33ec60125ab.tar nvim-treesitter-25f99a270ac94afd7a4adc8c2055d33ec60125ab.tar.gz nvim-treesitter-25f99a270ac94afd7a4adc8c2055d33ec60125ab.tar.bz2 nvim-treesitter-25f99a270ac94afd7a4adc8c2055d33ec60125ab.tar.lz nvim-treesitter-25f99a270ac94afd7a4adc8c2055d33ec60125ab.tar.xz nvim-treesitter-25f99a270ac94afd7a4adc8c2055d33ec60125ab.tar.zst nvim-treesitter-25f99a270ac94afd7a4adc8c2055d33ec60125ab.zip | |
feat(lua): add luap injections
Diffstat (limited to 'queries/lua')
| -rw-r--r-- | queries/lua/injections.scm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/queries/lua/injections.scm b/queries/lua/injections.scm index c11e3fb29..14714573a 100644 --- a/queries/lua/injections.scm +++ b/queries/lua/injections.scm @@ -19,4 +19,30 @@ ;; highlight string as query if starts with `;; query` ((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query")) +; string.match("123", "%d+") +(function_call + (dot_index_expression + field: (identifier) @_method + (#any-of? @_method "find" "match")) + arguments: (arguments (_) . (string content: _ @luap))) + +(function_call + (dot_index_expression + field: (identifier) @_method + (#eq? @_method "gmatch" "gsub")) + arguments: (arguments (_) (string content: _ @luap))) + +; ("123"):match("%d+") +(function_call + (method_index_expression + method: (identifier) @_method + (#any-of? @_method "find" "match")) + arguments: (arguments . (string content: _ @luap))) + +(function_call + (method_index_expression + method: (identifier) @_method + (#any-of? @_method "gmatch" "gsub")) + arguments: (arguments (string content: _ @luap))) + (comment) @comment |
