Skip to content

ERROR: script/core/hint.lua:320: attempt to index a nil value (local 'last') #2788

Description

@tmillr

How are you using the lua-language-server?

NeoVim 0.10.1
LuaLS 3.9.3

Which OS are you using?

MacOS

What is the issue affecting?

Other

Expected Behaviour

no error

Actual Behaviour

Almost every time I open a file in my editor, I get this error (multiple at a time):

[20:55:15.316][error][#0:script/core/hint.lua:320]: script/core/hint.lua:320: attempt to index a nil value (local 'last')
stack traceback:
	script/core/hint.lua:320: in local 'callback'
	script/parser/guide.lua:770: in function 'parser.guide.eachSourceTypes'
	script/core/hint.lua:288: in upvalue 'semicolonHint'
	script/core/hint.lua:335: in function 'core.hint'
	script/provider/provider.lua:1407: in function <script/provider/provider.lua:1395>
	[C]: in function 'xpcall'
	script/proto/proto.lua:200: in function <script/proto/proto.lua:175>

Reproduction steps

Open an existing Lua file in neovim.

Additional Notes

Config:

require('lspconfig').lua_ls.setup {
  capabilities = require('cmp_nvim_lsp').default_capabilities(),

  settings = {
    Lua = {
      completion = {
        enable = true,
        autoRequire = true,
        keywordSnippet = 'Replace',
        displayContext = 0,
        postfix = '.',
        requireSeparator = '.',
        showParams = true,
      },

      runtime = {
        path = {
          'lua/?.lua',
          'lua/?/init.lua',
        },
        pathStrict = true,
        version = 'LuaJIT',
      },

      diagnostics = {
        enable = true,
        unusedLocalExclude = { '_*' },
      },

      type = {},

      workspace = {
        library = { vim.env.VIMRUNTIME },
      },

      format = { enable = false, defaultConfig = {} },

      hint = {
        enable = true,
        arrayIndex = 'Enabled',
        paramName = 'All',
        paramType = true,
        semicolon = 'All',
        setType = true,
      },

      hover = {
        enable = true,
        enumsLimit = 100,
        expandAlias = true,
      },

      signatureHelp = { enable = true },

      spell = {},

      semantic = {
        enable = false,
        annotation = true,
        keyword = false,
        variable = false,
      },

      telemetry = {
        enable = false,
      },
    },
  },
}

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions