Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix healthcheck using deprecated functions #71

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

cdevoogd
Copy link
Contributor

@cdevoogd cdevoogd commented Sep 17, 2024

Description

This fixes :checkhealth from showing deprecation warnings in 0.10.0+.

In neovim 0.10, the vim.health.report_* functions were deprecated. It is recommended to use the new functions which use the same name without the report_ prefix (i.e. vim.health.start, vim.health.ok, etc). The deprecated functions will be removed in 0.11.

Testing

I just set up a minimal config that loads my local version of the plugin. Then I used bob to switch between versions to test from 0.7 to 0.10

vim.opt.runtimepath:prepend("~/src/nvim-go")

This is what the current main branch shows on 0.10.0 before any fixes. There are also additional warnings and stack traces in :messages.

go: require("go.health").check()

- WARNING vim.health.report_start() is deprecated, use vim.health.start() instead. :help |deprecated|
  Feature will be removed in Nvim 0.11

Binaries ~
- WARNING vim.health.report_info() is deprecated, use vim.health.info() instead. :help |deprecated|
  Feature will be removed in Nvim 0.11
- Go installed.
- Tool installed: gopls
- Tool installed: golint
- Tool installed: revive
- Tool installed: goimports
- Tool installed: gofumpt
- Tool installed: errcheck
- Tool installed: staticcheck
- Tool installed: golangci-lint
- Tool installed: gomodifytags
- Tool installed: quicktype
- Tool installed: gotests
- Tool installed: iferr
- WARNING vim.health.report_ok() is deprecated, use vim.health.ok() instead. :help |deprecated|
  Feature will be removed in Nvim 0.11
- OK No issues found

I then tested the changes on 0.10.0, 0.9.0, 0.8.0, and 0.7.2 (that's the first release with a mac binary that supports ARM) since the project's readme mentions working on version >= 0.7. There are no more deprecation warnings and no more warnings in :messages

go: require("go.health").check()

Binaries ~
- Go installed.
- Tool installed: gopls
- Tool installed: golint
- Tool installed: revive
- Tool installed: goimports
- Tool installed: gofumpt
- Tool installed: errcheck
- Tool installed: staticcheck
- Tool installed: golangci-lint
- Tool installed: gomodifytags
- Tool installed: quicktype
- Tool installed: gotests
- Tool installed: iferr
- OK No issues found

In neovim 0.10, the vim.health.report_* functions were deprecated. It is
recommended to use the new functions which use the same name without the
"report_" prefix (i.e. vim.health.start, vim.health.ok, etc). The
deprecated functions will be removed in 0.11.
@crispgm
Copy link
Owner

crispgm commented Sep 17, 2024

Thank you very much!

@crispgm crispgm merged commit 78a67e2 into crispgm:main Sep 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants