efmls-configs-nvim icon indicating copy to clipboard operation
efmls-configs-nvim copied to clipboard

fix: require('health') is deprecated

Open Allen191819 opened this issue 3 years ago • 1 comments

In the new version, require('health') is replaced by vim.health.

Allen191819 avatar Sep 15 '22 13:09 Allen191819

Hmm I don't see any deprecation warnings on 0.7 but see them on nightly only.

I don't really want to break compatibility with the stable release, so it would be best if you could add a condition to use vim.health if the version is 0.8 but drop down to the require('health') otherwise.

Something of the following at the top:

local health = nil

if vim.fn.has('0.8') == 1 then
  health = vim.health
else
  health = require('health')
end

creativenull avatar Sep 15 '22 20:09 creativenull

I know I'm really late to this but was wondering why this was closed?

You're still welcome to make the PR to ensure deprecation warnings aren't shown on 0.8, now that is it the stable nvim release :)

creativenull avatar Oct 19 '22 17:10 creativenull