Skip to content

enable deprecated warnings, minimum neovim version 0.9, harden support for greater versions #2787

@alex-courtis

Description

@alex-courtis
Member

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

gegoune commented on May 28, 2024

@gegoune
Collaborator

We shouldn't be concerned about development versions prior to 0.10. We should support:

  • latest release (0.10)
  • previous release (0.9)
  • current nightly versions (relatively new, 0.11-dev, without many (any?) guarantees)
alex-courtis

alex-courtis commented on Jun 1, 2024

@alex-courtis
MemberAuthor

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..." ?

changed the title [-]test api-level instead of vim.fn.has[/-] [+]fully support 0.9, 0.10 only[/+] on Jun 1, 2024
changed the title [-]fully support 0.9, 0.10 only[/-] [+]minimum neovim version 0.9, harden support for greater versions[/+] on Jun 1, 2024
changed the title [-]minimum neovim version 0.9, harden support for greater versions[/-] [+]enable deprecated warnings, minimum neovim version 0.9, harden support for greater versions[/+] on Jun 1, 2024
added 6 commits that reference this issue on Jun 1, 2024

6 remaining items

added 5 commits that reference this issue on Jun 1, 2024
added 4 commits that reference this issue on Jun 1, 2024
alex-courtis

alex-courtis commented on Jun 1, 2024

@alex-courtis
MemberAuthor

We shouldn't be concerned about development versions prior to 0.10. We should support:

  • latest release (0.10)
  • previous release (0.9)
  • current nightly versions (relatively new, 0.11-dev, without many (any?) guarantees)

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

added 2 commits that reference this issue on Jun 6, 2024
added a commit that references this issue on Jun 9, 2024
8704b6f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @alex-courtis@gegoune

      Issue actions

        enable deprecated warnings, minimum neovim version 0.9, harden support for greater versions · Issue #2787 · nvim-tree/nvim-tree.lua