summaryrefslogtreecommitdiff
path: root/lua/telescope
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2021-12-10 16:32:28 +0100
committerGitHub <noreply@github.com>2021-12-10 16:32:28 +0100
commit61240ac75a93b3cdafb4325ab4e9d407f83965f4 (patch)
tree76423432dc848be4e1c7a86ab37abb335c467794 /lua/telescope
parent80cdb00b221f69348afc4fb4b701f51eb8dd3120 (diff)
break: bump the minimum required neovim version to 0.6 or higher (#1549)
So we can use `vim.json` and `vim.diagnostics`. If you aren't able to update to 0.6.* yet you should pin the previous commit.
Diffstat (limited to 'lua/telescope')
-rw-r--r--lua/telescope/builtin/init.lua4
-rw-r--r--lua/telescope/builtin/internal.lua2
-rw-r--r--lua/telescope/builtin/lsp.lua10
-rw-r--r--lua/telescope/pickers/_test.lua4
4 files changed, 7 insertions, 13 deletions
diff --git a/lua/telescope/builtin/init.lua b/lua/telescope/builtin/init.lua
index 9330aec..66f3eda 100644
--- a/lua/telescope/builtin/init.lua
+++ b/lua/telescope/builtin/init.lua
@@ -26,8 +26,8 @@
--- </code>
---@brief ]]
-if 1 ~= vim.fn.has "nvim-0.5.1" then
- vim.api.nvim_err_writeln "This plugins requires neovim 0.5.1"
+if 1 ~= vim.fn.has "nvim-0.6.0" then
+ vim.api.nvim_err_writeln "This plugins requires neovim 0.6.0"
vim.api.nvim_err_writeln "Please update your neovim."
return
end
diff --git a/lua/telescope/builtin/internal.lua b/lua/telescope/builtin/internal.lua
index fa655f0..a868bc6 100644
--- a/lua/telescope/builtin/internal.lua
+++ b/lua/telescope/builtin/internal.lua
@@ -245,7 +245,7 @@ internal.symbols = function(opts)
local results = {}
for _, source in ipairs(sources) do
- local data = vim.fn.json_decode(Path:new(source):read())
+ local data = vim.json.decode(Path:new(source):read())
for _, entry in ipairs(data) do
table.insert(results, entry)
end
diff --git a/lua/telescope/builtin/lsp.lua b/lua/telescope/builtin/lsp.lua
index 3899264..149cfcb 100644
--- a/lua/telescope/builtin/lsp.lua
+++ b/lua/telescope/builtin/lsp.lua
@@ -380,16 +380,10 @@ local function get_workspace_symbols_requester(bufnr, opts)
_, cancel = vim.lsp.buf_request(bufnr, "workspace/symbol", { query = prompt }, tx)
-- Handle 0.5 / 0.5.1 handler situation
- local err, res_1, res_2 = rx()
- local results_lsp
- if type(res_1) == "table" then
- results_lsp = res_1
- else
- results_lsp = res_2
- end
+ local err, res = rx()
assert(not err, err)
- local locations = vim.lsp.util.symbols_to_items(results_lsp or {}, bufnr) or {}
+ local locations = vim.lsp.util.symbols_to_items(res or {}, bufnr) or {}
if not vim.tbl_isempty(locations) then
locations = utils.filter_symbols(locations, opts) or {}
end
diff --git a/lua/telescope/pickers/_test.lua b/lua/telescope/pickers/_test.lua
index 2124635..a8680d0 100644
--- a/lua/telescope/pickers/_test.lua
+++ b/lua/telescope/pickers/_test.lua
@@ -21,7 +21,7 @@ end
local writer = function(val)
if type(val) == "table" then
- val = vim.fn.json_encode(val) .. "\n"
+ val = vim.json.encode(val) .. "\n"
end
if tester.debug then
@@ -157,7 +157,7 @@ local get_results_from_file = function(file)
local results = j:stderr_result()
local result_table = {}
for _, v in ipairs(results) do
- table.insert(result_table, vim.fn.json_decode(v))
+ table.insert(result_table, vim.json.decode(v))
end
return result_table