aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel D'Alessandro <ariel.dalessandro@auto1.com>2022-09-26 15:06:46 +0200
committerAriel D'Alessandro <ariel.dalessandro@auto1.com>2022-09-26 15:06:46 +0200
commitfd46c9fa03cf4870b535ec3a7b8a7e87d5586015 (patch)
tree499ea3735dda27d22170ac005d9b4d2b87f9031f
parentb2ea5bb4976ad786a104d5539d47645ddef237a9 (diff)
downloadnvim-conf-fd46c9fa03cf4870b535ec3a7b8a7e87d5586015.tar.gz
nvim-conf-fd46c9fa03cf4870b535ec3a7b8a7e87d5586015.zip
Treesitter fix injections
-rw-r--r--after/queries/php/highlights.scm5
-rw-r--r--after/queries/php/indent.scm23
-rw-r--r--lua/alpha/snips/ft/php.lua4
-rw-r--r--queries/php/injections.scm1
-rw-r--r--queries/phpdoc/highlights.scm10
5 files changed, 15 insertions, 28 deletions
diff --git a/after/queries/php/highlights.scm b/after/queries/php/highlights.scm
deleted file mode 100644
index cc25270..0000000
--- a/after/queries/php/highlights.scm
+++ /dev/null
@@ -1,5 +0,0 @@
-[
- "fn"
- "function"
- "enum"
-] @keyword.function
diff --git a/after/queries/php/indent.scm b/after/queries/php/indent.scm
deleted file mode 100644
index 34f6db2..0000000
--- a/after/queries/php/indent.scm
+++ /dev/null
@@ -1,23 +0,0 @@
-[
- (array_creation_expression)
- (arguments)
- (formal_parameters)
- (compound_statement)
- (declaration_list)
- (binary_expression)
- (return_statement)
- (expression_steatement)
-] @indent
-
-[
- "("
- ")"
- "{"
- "}"
- "["
- "]"
-] @branch
-
-[
- (comment)
-] @ignore
diff --git a/lua/alpha/snips/ft/php.lua b/lua/alpha/snips/ft/php.lua
index 9673a49..5ca63f6 100644
--- a/lua/alpha/snips/ft/php.lua
+++ b/lua/alpha/snips/ft/php.lua
@@ -146,4 +146,8 @@ M.fn = {
newline("}"),
}
+M["then"] = fmt([[->then(function ({}) {{
+ {}
+}})]], {i(1, ""), i(2, "")})
+
return M
diff --git a/queries/php/injections.scm b/queries/php/injections.scm
index 3f809f7..93894b4 100644
--- a/queries/php/injections.scm
+++ b/queries/php/injections.scm
@@ -1,3 +1,4 @@
+;; extends
(function_call_expression
(
(name) @_function (#eq? @_function "json_decode")
diff --git a/queries/phpdoc/highlights.scm b/queries/phpdoc/highlights.scm
new file mode 100644
index 0000000..ff014dc
--- /dev/null
+++ b/queries/phpdoc/highlights.scm
@@ -0,0 +1,10 @@
+;;extends
+
+(tag
+ (type_list
+ (named_type
+ (name) @typeName (#eq? @typeName "Promise")
+ )
+ )
+ (description) @type
+)