aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/scratchs
diff options
context:
space:
mode:
authorAriel D'Alessandro <ariel.dalessandro@auto1.com>2022-09-20 17:45:11 +0200
committerAriel D'Alessandro <ariel.dalessandro@auto1.com>2022-09-20 17:45:44 +0200
commit7701e1e3ebf73c58d2636a0707c08dca459a15ff (patch)
treee2972ebb504088f4cc65cbbae699775c3f75c070 /lua/alpha/scratchs
parent0dbf8150681d38907a29a4aa1893faa3bda4b9c6 (diff)
downloadnvim-conf-7701e1e3ebf73c58d2636a0707c08dca459a15ff.tar.gz
nvim-conf-7701e1e3ebf73c58d2636a0707c08dca459a15ff.zip
disable hydra since was not working for the window as I was expecting
Diffstat (limited to 'lua/alpha/scratchs')
-rw-r--r--lua/alpha/scratchs/graphql_queries.lua (renamed from lua/alpha/scratchs/draft.lua)1
-rw-r--r--lua/alpha/scratchs/intelephense_symbol.lua28
2 files changed, 28 insertions, 1 deletions
diff --git a/lua/alpha/scratchs/draft.lua b/lua/alpha/scratchs/graphql_queries.lua
index 8954fdc..3997d86 100644
--- a/lua/alpha/scratchs/draft.lua
+++ b/lua/alpha/scratchs/graphql_queries.lua
@@ -32,7 +32,6 @@ local function getElements()
local parsers = require("nvim-treesitter.parsers")
local parser = parsers.get_parser(0)
- ---@diagnostic disable-next-line: deprecated
local tree = unpack(parser:parse())
for id, node in query:iter_captures(tree:root(), 0) do
diff --git a/lua/alpha/scratchs/intelephense_symbol.lua b/lua/alpha/scratchs/intelephense_symbol.lua
new file mode 100644
index 0000000..3f039f3
--- /dev/null
+++ b/lua/alpha/scratchs/intelephense_symbol.lua
@@ -0,0 +1,28 @@
+local function get_intelephense_buffer()
+ local clients = vim.lsp.get_active_clients({ name = "intelephense" })
+ if #clients == 0 then
+ return
+ end
+
+ local intelephense = clients[1]
+
+ local attached_buffers = intelephense.attached_buffers
+
+ for key, val in pairs(attached_buffers) do
+ if val then
+ return key
+ end
+ end
+
+ return nil
+end
+
+vim.keymap.set({'n'}, '<leader>pc', function ()
+ local buffer = get_intelephense_buffer()
+
+ if buffer == nil then
+ return
+ end
+
+ require("telescope.builtin").lsp_workspace_symbols({ bufnr = buffer, query = vim.fn.expand("<cword>") })
+end)