lua-lsp icon indicating copy to clipboard operation
lua-lsp copied to clipboard

Assertion failed "in upvalue 'make_position'"

Open thornjad opened this issue 3 years ago • 0 comments

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!

thornjad avatar May 10 '21 21:05 thornjad