Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Error executing vim.schedule lua callback: diagnostic-nvim/lua/diagnostic/util.lua:155: index out of range #46

Open
@kdheepak

Description

@kdheepak

I get this error every now and then. I think it occurs when there's a large number of diagnostics in the same buffer from a language server. I'm now able to consistently reproduce this error in a Julia file.

Screen Shot 2020-07-19 at 1 27 31 AM

If I hit enter the error message continues popping up.

Activity

haorenW1025

haorenW1025 commented on Jul 20, 2020

@haorenW1025
Collaborator

Have you updated diagnostic-nvim? I think #38 fixes it.

kdheepak

kdheepak commented on Jul 20, 2020

@kdheepak
Author

I just tried again with the latest commit, and I still get the same errors.

linked a pull request that will close this issue on Jul 21, 2020
haorenW1025

haorenW1025 commented on Jul 21, 2020

@haorenW1025
Collaborator

I can't reproduce on my side, so let see if the PR fixes it.

el-iot

el-iot commented on Jul 21, 2020

@el-iot
Contributor

I found I had the same issue while using the python-language-server. Specifically, one of my linters (pyflakes) would label the starting positions of particular errors as -1, which caused an index-out-of-bounds error. I added these lines at line 91 of diagnostic-nvim/lua/diagnostic.lua

  for _, diagnostic in ipairs(result['diagnostics']) do
    if diagnostic['range']['start']['character'] < 0 then diagnostic['range']['start']['character'] = 0 end
  end

and it has fixed my issues. @haorenW1025, if I can tidy up the implementation a little would you consider this a good pull-request? If so I can put it together (I'll also check to make sure the end-character doesn't exceed the length of the line in case some other language-servers do that).

el-iot

el-iot commented on Jul 21, 2020

@el-iot
Contributor

Apologies - I'm not completely up-to-date so it may not be at line 91 of diagnostic-nvim/lua/diagnostic.lua (I was previously on f8b312d)

el-iot

el-iot commented on Jul 24, 2020

@el-iot
Contributor

Made a pull-request for this issue (#51) that has fixed this for me (incase #48 doesn't work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @kdheepak@el-iot@haorenW1025

      Issue actions

        Error executing vim.schedule lua callback: diagnostic-nvim/lua/diagnostic/util.lua:155: index out of range · Issue #46 · nvim-lua/diagnostic-nvim