typescript treesitter injection for angular templates

This commit is contained in:
2023-06-23 19:51:54 -05:00
parent 356ed03d2f
commit ee951b099b
4 changed files with 33 additions and 17 deletions
+5 -1
View File
@@ -50,8 +50,12 @@ function M.rnvimr()
end
function M.nvim_fzf()
local bat_command = "bat --color=always --style=header,grid --line-range :300 {}"
local default_command = "strings {+}"
local preview = '[[ -n "$(command -v bat)" ]] && ' .. bat_command .. " || " .. default_command
require("fzf").default_options = {
fzf_cli_args = " --height 100% --preview='[[ -n \"$(command -v bat)\" ]] && bat --color=always --style=header,grid --line-range :300 {} || strings {+}' ",
fzf_cli_args = " --height 100% --preview='" .. preview .. "' ",
}
end
+4 -11
View File
@@ -1,21 +1,14 @@
((attribute
(attribute_name) @_alpine
(quoted_attribute_value (attribute_value) @javascript))
(quoted_attribute_value
(attribute_value) @javascript))
(#lua-match? @_alpine "^[@:]%l+.-$"))
((attribute
(attribute_name) @_alpine
(quoted_attribute_value (attribute_value) @javascript))
(quoted_attribute_value
(attribute_value) @javascript))
(#lua-match? @_alpine "^x[-]%l+$"))
(script_element
(raw_text) @javascript)
;((text) @htmldjango (#lua-match? @htmldjango "^{%p%s+%l+.-%s+%p}$"))
;
;((text) @htmldjango (#lua-match? @htmldjango "^{{%s+.-%s+}}$"))
;
;((attribute
; (quoted_attribute_value (attribute_value) @htmldjango))
; (#lua-match? @htmldjango "^{{%s+.-%s+}}$"))
+14 -5
View File
@@ -1,16 +1,25 @@
(type (string (string_content) @python))
((assignment
(type (identifier) @_type)
(string (string_content) @python))
(type
(identifier) @_type)
(string
(string_content) @python))
(#eq? @_type "TypeAlias"))
((assignment
(type (string (string_content) @_type))
(string (string_content) @python))
(type
(string
(string_content) @_type))
(string
(string_content) @python))
(#eq? @_type "TypeAlias"))
(class_definition (argument_list (subscript (string (string_content) @python))))
(class_definition
(argument_list
(subscript
(string
(string_content) @python))))
(((string (string_content) @python) @_str)
(#match? @_str "^r.*$"))
+10
View File
@@ -0,0 +1,10 @@
; angular inline templates
((decorator
(call_expression
(identifier) @_decorator
(arguments
(object
(pair
(property_identifier) @_key
(template_string) @html)))))
(#eq? @_decorator "Component") (#eq? @_key "template"))