Skip to content

Fix deprecated vim.lsp.diagnostic.get_count call#226

Open
CHNB128 wants to merge 1 commit intonvimdev:mainfrom
CHNB128:main
Open

Fix deprecated vim.lsp.diagnostic.get_count call#226
CHNB128 wants to merge 1 commit intonvimdev:mainfrom
CHNB128:main

Conversation

@CHNB128
Copy link

@CHNB128 CHNB128 commented Jan 14, 2022

No description provided.

@CHNB128 CHNB128 force-pushed the main branch 3 times, most recently from 1e1a6bc to bc079ff Compare January 14, 2022 08:31
count = count + lsp.diagnostic.get_count(api.nvim_get_current_buf(),diag_type,client.id)
local opts = { severity = diag_type }
opts.namespace = vim.diagnostic.get_namespace(client.id)
count = count + vim.diagnostic.get(api.nvim_get_current_buf(),opts)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch gives arithmetic errors when displaying the diagnostics at the galaxystatus line.

I may be wrong, but aren't you here adding a scalar count to a table from vim.diagnostic.get().

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed this in my fork if you're interested.
https://github.com/justinhj/galaxyline.nvim/blob/main/README.md

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.

3 participants