From 632024157d01e8bc48fd7df6a7de8ffe3fdd4f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3n=C3=A1n=20Carrigan?= Date: Wed, 22 May 2024 16:25:37 +0100 Subject: [PATCH] fix(lsp): use vim.lsp.get_clients Closes #19 --- lua/nio/curl.lua | 14 ++++++++++++++ lua/nio/lsp.lua | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 lua/nio/curl.lua diff --git a/lua/nio/curl.lua b/lua/nio/curl.lua new file mode 100644 index 0000000..93b77d2 --- /dev/null +++ b/lua/nio/curl.lua @@ -0,0 +1,14 @@ +local process = require("nio.process") + +local nio = {} + +---@class nio.curl +nio.curl = {} + +---@class nio.curl.RequestOpts +---@field method string The HTTP method to use +---@field url string The URL to request +---@field headers table The headers to send +---@field body string The body to send + +function nio.curl.request(opts) end diff --git a/lua/nio/lsp.lua b/lua/nio/lsp.lua index 0d1d069..4692aba 100644 --- a/lua/nio/lsp.lua +++ b/lua/nio/lsp.lua @@ -32,7 +32,7 @@ end, 6) ---@return nio.lsp.Client[] function nio.lsp.get_clients(filters) local clients = {} - for _, client in pairs(vim.lsp.get_active_clients(filters)) do + for _, client in pairs((vim.lsp.get_clients or vim.lsp.get_active_clients)(filters)) do clients[#clients + 1] = nio.lsp.convert_client(client) end return clients