aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/php/gateway.lua
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-02-03 11:14:46 +0100
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-02-03 11:14:46 +0100
commit5b2542081b433fd24dc4ae35335a767815e5d986 (patch)
tree62fbf6088217dbfcf6de5d5d0926adba035fbab2 /lua/alpha/php/gateway.lua
parent5d66bc69c60f225a000fd4cf3c4beaaa60dc07b4 (diff)
downloadnvim-conf-5b2542081b433fd24dc4ae35335a767815e5d986.tar.gz
nvim-conf-5b2542081b433fd24dc4ae35335a767815e5d986.zip
fix: fix the unpact of the tree sitter. fix some names
Diffstat (limited to 'lua/alpha/php/gateway.lua')
-rw-r--r--lua/alpha/php/gateway.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/alpha/php/gateway.lua b/lua/alpha/php/gateway.lua
index 51f230b..614c4f2 100644
--- a/lua/alpha/php/gateway.lua
+++ b/lua/alpha/php/gateway.lua
@@ -26,7 +26,7 @@ local get_all_definitions = function()
return mutations_definitions
end
--- "'@=mutation(\"App\\\\GraphQL\\\\Mutation\\\\ImageMutation::deleteVehicleImage\", args[\"inspectionId\"], args[\"url\"], info)'",
+-- "'@=mutation(\"App\\\\GraphQL\\\\Mutations\\\\Mutation::action\", ...)'",
local open_resolver = function(resolver)
-- need to parse to get this values
local args = string.match(resolver, "'@=mutation%((.+)%)'")
@@ -44,7 +44,7 @@ local open_resolver = function(resolver)
fqn = string.gsub(fqn, "\\\\", "\\")
-- P(fqn)
- R("alpha.php.lsp").find(fqn, "phpactor")
+ require("alpha.php.lsp").find(fqn, "phpactor")
end
--- @param bufnr integer Buff id
@@ -75,7 +75,7 @@ gateway.get_graphql_definitions = function(bufnr)
local parsers = require "nvim-treesitter.parsers"
local parser = parsers.get_parser(bufnr)
- local tree = unpack(parser:parse())
+ local tree = parser:parse()[1]
for id, node in query:iter_captures(tree:root(), bufnr) do
if query.captures[id] == "mutation" then
@@ -104,7 +104,7 @@ gateway.graphql_definitions = function(opts)
entry_maker = function(entry)
-- buffer = 43,
-- lnum = 82,
- -- resolver = "'@=mutation(\"App\\\\GraphQL\\\\Mutation\\\\ImageMutation::deleteVehicleImage\", args[\"inspectionId\"], args[\"url\"], info)'",
+ -- resolver = "'@=mutation(\"App\\\\GraphQL\\\\Mutation\\\\Mutation::action\", ...)'",
-- value = "deleteVehicleImage"
return {
value = entry,