typescript treesitter injection for angular templates
This commit is contained in:
@@ -50,8 +50,12 @@ function M.rnvimr()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.nvim_fzf()
|
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 = {
|
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
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,14 @@
|
|||||||
((attribute
|
((attribute
|
||||||
(attribute_name) @_alpine
|
(attribute_name) @_alpine
|
||||||
(quoted_attribute_value (attribute_value) @javascript))
|
(quoted_attribute_value
|
||||||
|
(attribute_value) @javascript))
|
||||||
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||||
|
|
||||||
((attribute
|
((attribute
|
||||||
(attribute_name) @_alpine
|
(attribute_name) @_alpine
|
||||||
(quoted_attribute_value (attribute_value) @javascript))
|
(quoted_attribute_value
|
||||||
|
(attribute_value) @javascript))
|
||||||
(#lua-match? @_alpine "^x[-]%l+$"))
|
(#lua-match? @_alpine "^x[-]%l+$"))
|
||||||
|
|
||||||
(script_element
|
(script_element
|
||||||
(raw_text) @javascript)
|
(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+}}$"))
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,25 @@
|
|||||||
(type (string (string_content) @python))
|
(type (string (string_content) @python))
|
||||||
|
|
||||||
((assignment
|
((assignment
|
||||||
(type (identifier) @_type)
|
(type
|
||||||
(string (string_content) @python))
|
(identifier) @_type)
|
||||||
|
(string
|
||||||
|
(string_content) @python))
|
||||||
(#eq? @_type "TypeAlias"))
|
(#eq? @_type "TypeAlias"))
|
||||||
|
|
||||||
((assignment
|
((assignment
|
||||||
(type (string (string_content) @_type))
|
(type
|
||||||
(string (string_content) @python))
|
(string
|
||||||
|
(string_content) @_type))
|
||||||
|
(string
|
||||||
|
(string_content) @python))
|
||||||
(#eq? @_type "TypeAlias"))
|
(#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)
|
(((string (string_content) @python) @_str)
|
||||||
(#match? @_str "^r.*$"))
|
(#match? @_str "^r.*$"))
|
||||||
|
|||||||
@@ -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"))
|
||||||
Reference in New Issue
Block a user