Skip to content

Conversation

@JulianVidal
Copy link

Description

When running vim.diagnostic.setloclist() the following error occurs:

E5108: Error executing lua: Vim:E805: Using a Float as a Number
stack traceback:
    [C]: in function 'setloclist'
    .../share/nvim/runtime/lua/vim/diagnostic.lua:913 in function 'set list'
    .../share/nvim/runtime/lua/vim/diagnostic.lua:2446: in function <.../share/nvim/runtime/lua/vim/diagnositc.lua:2445>

Installed nvim-lint with lazy.nvim and checkstyle through Mason, then configured linters_by_ft to use checkstyle with Java.

Solution

The SARIF parser returns math.huge if region.endColumn doesn't exist, which is a float and therefore not accepted by setloclist. Using -1 instead of math.huge fixes the error.

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.

1 participant