From 09361db9ee52be27ddb27320eda8121223330f04 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Fri, 17 Jun 2022 17:39:56 +0200 Subject: commits from laptop --- lua/alpha/php_code_actions.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lua/alpha/php_code_actions.lua') diff --git a/lua/alpha/php_code_actions.lua b/lua/alpha/php_code_actions.lua index f43245b..3d6b5e9 100644 --- a/lua/alpha/php_code_actions.lua +++ b/lua/alpha/php_code_actions.lua @@ -45,7 +45,9 @@ vim.treesitter.set_query( ]] ) -local php_setter_getter_actions = { +local M = {} + +M.php_setter_getter_actions = { method = null_ls.methods.CODE_ACTION, filetypes = { "php" }, generator = { @@ -86,6 +88,7 @@ local php_setter_getter_actions = { for _, match in comment_query:iter_matches(test_node, 0) do for _, subNode in pairs(match) do local type = get_node_text(subNode, 0) + P(type) if type ~= "null" then table.insert(property_types, type) else @@ -94,6 +97,7 @@ local php_setter_getter_actions = { end end + P(property_types) local getter = generator.getGetter(property_name, nullable, property_types) local setter = generator.getSetter(property_name, nullable, property_types) @@ -126,6 +130,5 @@ local php_setter_getter_actions = { end, }, } --- uncomment when not developing this -null_ls.reset_sources() -null_ls.register(php_setter_getter_actions) + +return M -- cgit v1.2.3