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.
This commit is contained in:
Simon Hauser
2021-12-10 16:32:28 +01:00
committed by GitHub
parent 80cdb00b22
commit 61240ac75a
9 changed files with 29 additions and 24 deletions

View File

@@ -15,7 +15,7 @@ jobs:
manager: sudo apt-get manager: sudo apt-get
packages: -y fd-find packages: -y fd-find
- os: ubuntu-20.04 - os: ubuntu-20.04
url: https://github.com/neovim/neovim/releases/download/v0.5.1/nvim-linux64.tar.gz url: https://github.com/neovim/neovim/releases/download/v0.6.0/nvim-linux64.tar.gz
manager: sudo apt-get manager: sudo apt-get
packages: -y fd-find packages: -y fd-find
- os: macos-10.15 - os: macos-10.15
@@ -23,7 +23,7 @@ jobs:
manager: brew manager: brew
packages: fd packages: fd
- os: macos-10.15 - os: macos-10.15
url: https://github.com/neovim/neovim/releases/download/v0.5.1/nvim-macos.tar.gz url: https://github.com/neovim/neovim/releases/download/v0.6.0/nvim-macos.tar.gz
manager: brew manager: brew
packages: fd packages: fd
steps: steps:

View File

@@ -41,7 +41,7 @@ Telescope Wiki</sub>
This section should guide you to run your first builtin pickers. This section should guide you to run your first builtin pickers.
[Neovim (v0.5.1)](https://github.com/neovim/neovim/releases/tag/v0.5.1) or the [Neovim (v0.6.0)](https://github.com/neovim/neovim/releases/tag/v0.6.0) or the
latest neovim nightly commit is required for `telescope.nvim` to work. latest neovim nightly commit is required for `telescope.nvim` to work.
### Suggested dependencies ### Suggested dependencies

View File

@@ -131,4 +131,15 @@ requires users to be on Neovim 0.5.1 (the most recent stable version) or on
the LATEST version of Neovim nightly. the LATEST version of Neovim nightly.
*telescope.changelog-1549*
Date: December 10, 2021
PR: https://github.com/nvim-telescope/telescope.nvim/pull/1549
Telescope requires now Neovim release 0.6.0 or a more recent nightly.
If you are running neovim nightly, you need to make sure that you are on the
LATEST version. Every other commit is not supported. So make sure you build
the newest nightly before reporting issues.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@@ -26,8 +26,8 @@
--- </code> --- </code>
---@brief ]] ---@brief ]]
if 1 ~= vim.fn.has "nvim-0.5.1" then if 1 ~= vim.fn.has "nvim-0.6.0" then
vim.api.nvim_err_writeln "This plugins requires neovim 0.5.1" vim.api.nvim_err_writeln "This plugins requires neovim 0.6.0"
vim.api.nvim_err_writeln "Please update your neovim." vim.api.nvim_err_writeln "Please update your neovim."
return return
end end

View File

@@ -245,7 +245,7 @@ internal.symbols = function(opts)
local results = {} local results = {}
for _, source in ipairs(sources) do 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 for _, entry in ipairs(data) do
table.insert(results, entry) table.insert(results, entry)
end end

View File

@@ -380,16 +380,10 @@ local function get_workspace_symbols_requester(bufnr, opts)
_, cancel = vim.lsp.buf_request(bufnr, "workspace/symbol", { query = prompt }, tx) _, cancel = vim.lsp.buf_request(bufnr, "workspace/symbol", { query = prompt }, tx)
-- Handle 0.5 / 0.5.1 handler situation -- Handle 0.5 / 0.5.1 handler situation
local err, res_1, res_2 = rx() local err, res = rx()
local results_lsp
if type(res_1) == "table" then
results_lsp = res_1
else
results_lsp = res_2
end
assert(not err, err) 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 if not vim.tbl_isempty(locations) then
locations = utils.filter_symbols(locations, opts) or {} locations = utils.filter_symbols(locations, opts) or {}
end end

View File

@@ -21,7 +21,7 @@ end
local writer = function(val) local writer = function(val)
if type(val) == "table" then if type(val) == "table" then
val = vim.fn.json_encode(val) .. "\n" val = vim.json.encode(val) .. "\n"
end end
if tester.debug then if tester.debug then
@@ -157,7 +157,7 @@ local get_results_from_file = function(file)
local results = j:stderr_result() local results = j:stderr_result()
local result_table = {} local result_table = {}
for _, v in ipairs(results) do for _, v in ipairs(results) do
table.insert(result_table, vim.fn.json_decode(v)) table.insert(result_table, vim.json.decode(v))
end end
return result_table return result_table

View File

@@ -42,9 +42,9 @@ describe("builtin.find_files", function()
width = 0.9, width = 0.9,
}, },
border = false, border = false,
}, vim.fn.json_decode([==[%s]==]))) }, vim.json.decode([==[%s]==])))
]], ]],
vim.fn.json_encode(configuration) vim.json.encode(configuration)
)) ))
end) end)
@@ -73,10 +73,10 @@ describe("builtin.find_files", function()
width = 0.9, width = 0.9,
}, },
border = false, border = false,
}, vim.fn.json_decode([==[%s]==]))) }, vim.json.decode([==[%s]==])))
]], ]],
expected, expected,
vim.fn.json_encode(configuration) vim.json.encode(configuration)
)) ))
end) end)
@@ -99,9 +99,9 @@ describe("builtin.find_files", function()
}, vim.tbl_extend("force", { }, vim.tbl_extend("force", {
disable_devicons = false, disable_devicons = false,
sorter = require('telescope.sorters').get_fzy_sorter(), sorter = require('telescope.sorters').get_fzy_sorter(),
}, vim.fn.json_decode([==[%s]==]))) }, vim.json.decode([==[%s]==])))
]], ]],
vim.fn.json_encode(configuration) vim.json.encode(configuration)
)) ))
end) end)
end end

View File

@@ -1,5 +1,5 @@
if !has('nvim-0.5.1') if !has('nvim-0.6.0')
echoerr "Telescope.nvim requires at least nvim-0.5.1. See `:h telescope.changelog-1406`" echoerr "Telescope.nvim requires at least nvim-0.6.0. See `:h telescope.changelog-1549`"
finish finish
end end