Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Assertion failed "in upvalue 'make_position'" #41

@thornjad

Description

@thornjad

Not very familiar with Lua, so I don't know how to find much more info than this. It seems to start happening if I start using a variable without declaring it.

LSP :: Error from the Language Server: /usr/local/share/lua/5.3/lua-lsp/methods.lua:308: assertion failed!
stack traceback:
	[C]: in function 'assert'
	/usr/local/share/lua/5.3/lua-lsp/methods.lua:308: in upvalue 'make_position'
	/usr/local/share/lua/5.3/lua-lsp/methods.lua:324: in upvalue 'make_range'
	/usr/local/share/lua/5.3/lua-lsp/methods.lua:334: in upvalue 'make_location'
	/usr/local/share/lua/5.3/lua-lsp/methods.lua:711: in function 'lua-lsp.methods.textDocument/documentSymbol'
	/usr/local/share/lua/5.3/lua-lsp/loop.lua:57: in function </usr/local/share/lua/5.3/lua-lsp/loop.lua:56>
	[C]: in function 'xpcall'
	/usr/local/share/lua/5.3/lua-lsp/loop.lua:56: in function 'lua-lsp.loop'
	/usr/local/lib/luarocks/rocks/lua-lsp/scm-5/bin/lua-lsp:3: in main chunk
	[C]: in ? (Internal Error)

Interestingly, according to the line number, the assertion that's failing is assert(pos <= document.text:len()).

However, this error goes away if I restart the server, even without changing any code.

Let me know if (and how?) to get any extra info!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions