- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 629
Closed
Labels
Description
API changed many times during the 0.10 dev cycle. Many users are using various versions of 0.10 pre-release. We must ensure that the correct functions are being used. Resolves issues such as #2781 (comment)
We can use a lazily loaded cache of supported API. Requires minimum nvim version of 0.9
Testing :h api-level
local log = require "amc.log"
local api_info = vim.fn.api_info()
log.line("version %s", vim.inspect(api_info.version))
log.line("ui_options %s", vim.inspect(api_info.ui_options))
for _, v in ipairs(api_info.functions) do
if v.deprecated_since and v.deprecated_since ~= 1 then
log.line("%s %s %s", v.name, vim.inspect(v.since), vim.inspect(v.deprecated_since))
end
end
0.9.5
version {
api_compatible = 0,
api_level = 11,
api_prerelease = false,
major = 0,
minor = 9,
patch = 5,
prerelease = false
}
nvim_exec 7 11
nvim_command_output 1 7
nvim_execute_lua 3 7
nvim_buf_get_number 1 2
nvim_buf_clear_highlight 1 7
nvim_buf_set_virtual_text 5 8
nvim_get_hl_by_id 3 9
nvim_get_hl_by_name 3 9
0.10.0
version {
api_compatible = 0,
api_level = 12,
api_prerelease = vim.NIL,
build = vim.NIL,
major = 0,
minor = 10,
patch = 0,
prerelease = true
}
nvim_exec 7 11
nvim_command_output 1 7
nvim_execute_lua 3 7
nvim_buf_get_number 1 2
nvim_buf_clear_highlight 1 7
nvim_buf_set_virtual_text 5 8
nvim_get_hl_by_id 3 9
nvim_get_hl_by_name 3 9
nvim_get_option_info 7 11
nvim_set_option 1 11
nvim_get_option 1 11
nvim_buf_get_option 1 11
nvim_buf_set_option 1 11
nvim_win_get_option 1 11
nvim_win_set_option 1 11
nvim_call_atomic 1 12
Activity
gegoune commentedon May 28, 2024
We shouldn't be concerned about development versions prior to 0.10. We should support:
alex-courtis commentedon Jun 1, 2024
That works for me. We can continue to use the simple vim.fn test and keep the code clean.
The only issue is users on 0.10 dev versions (debian!), which do break. Could we just show a startup warning like "...proceed at your own risk..." ?
[-]test api-level instead of vim.fn.has[/-][+]fully support 0.9, 0.10 only[/+][-]fully support 0.9, 0.10 only[/-][+]minimum neovim version 0.9, harden support for greater versions[/+][-]minimum neovim version 0.9, harden support for greater versions[/-][+]enable deprecated warnings, minimum neovim version 0.9, harden support for greater versions[/+]refactor(#2787): replace deprecated
refactor(#2787): enable deprecated checks
refactor(#2787): replace deprecated
refactor(#2787): replace deprecated
refactor(#2787): replace deprecated
refactor(#2787): replace deprecated
6 remaining items
refactor(#2787): replace deprecated
refactor(#2787): replace deprecated
refactor(#2787): replace deprecated
refactor(#2787): replace deprecated
refactor(#2787): deprecated are now warnings
refactor(#2787): 0.9 is the minimum supported version
Revert "refactor(#2787): replace deprecated"
refactor(#2787): suppress deprecated until 0.11
refactor(#2787): minimum nvim version 0.8 -> 0.9
alex-courtis commentedon Jun 1, 2024
I couldn't find a reliable way to detect dev versions; 0.9 is now the minimum and it's up to the user to deal with issues with dev versions.
I did put off that diagnostic breakage until 0.11 as more users will likely raise issues. https://github.com/nvim-tree/nvim-tree.lua/pull/2788/files#diff-b4d683774fedaa8bdc2f7107576331513b01888c09ab2fcfd44468ef976c1b08
refactor(#2787): reset globals
refactor(#2787): explicitly check for vim.diagnostic.is_enabled funct…
chore(#2787): minimum nvim version 0.9, replace 0.10 deprecated, enab…