Skip to content

Error upon every action if file isn't .lua #719

@Nixill

Description

@Nixill

Describe the bug
If a file isn't a .lua file, but has its language set to (or detected as) Lua anyway, an error occurs every single time any action is taken in that file (scroll, type one key, click anywhere, etc).

To Reproduce
Steps to reproduce the behavior:

  1. Create a file with the extension .txt
  2. Manually set the file's language to Lua
  3. Do literally anything
  4. Error pops up

Expected behavior
Expected behavior is syntax highlighting and some autocompletion features.

Environment (please complete the following information):

  • OS: Windows
  • Is WSL remote? (no)
  • Client: VSCode Insiders

Provide logs

[16:33:05.349][debug][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/provider\provider.lua:165]: didOpen	file:///c%3A/Users/Nixill/Programs/Synchrony/Synchrony/components-41.2.txt
[16:33:05.349][debug][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:135]: Method [textDocument/documentSymbol] takes [0.812]sec.
[16:33:05.349][debug][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:135]: Method [textDocument/semanticTokens/range] takes [0.806]sec.
[16:33:05.349][debug][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:135]: Method [textDocument/semanticTokens/range] takes [0.641]sec.
[16:33:06.349][debug][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:135]: Method [textDocument/didOpen] takes [1.814]sec.
[16:33:08.521][debug][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/provider\diagnostic.lua:358]: 全文诊断耗时:	1.166
[16:33:12.021][error][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/proto\converter.lua:131]: ...ions\sumneko.lua-2.4.2\server/script/proto\converter.lua:69: attempt to index a nil value (local 'state')
stack traceback:
	...ions\sumneko.lua-2.4.2\server/script/proto\converter.lua:131: in function 'proto.converter.unpackRange'
	...ns\sumneko.lua-2.4.2\server/script/provider\provider.lua:617: in function <...ns\sumneko.lua-2.4.2\server/script/provider\provider.lua:608>
	[C]: in function 'xpcall'
	...tensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:148: in function <...tensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:123>
[16:33:12.834][error][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/proto\converter.lua:132]: ...ions\sumneko.lua-2.4.2\server/script/proto\converter.lua:69: attempt to index a nil value (local 'state')
stack traceback:
	...ions\sumneko.lua-2.4.2\server/script/proto\converter.lua:132: in function 'proto.converter.unpackRange'
	...ns\sumneko.lua-2.4.2\server/script/provider\provider.lua:711: in function <...ns\sumneko.lua-2.4.2\server/script/provider\provider.lua:699>
	[C]: in function 'xpcall'
	...tensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:148: in function <...tensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:123>
[16:33:12.990][error][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/proto\converter.lua:131]: ...ions\sumneko.lua-2.4.2\server/script/proto\converter.lua:69: attempt to index a nil value (local 'state')
stack traceback:
	...ions\sumneko.lua-2.4.2\server/script/proto\converter.lua:131: in function 'proto.converter.unpackRange'
	...ns\sumneko.lua-2.4.2\server/script/provider\provider.lua:617: in function <...ns\sumneko.lua-2.4.2\server/script/provider\provider.lua:608>
	[C]: in function 'xpcall'
	...tensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:148: in function <...tensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:123>
[16:33:14.849][error][#0:c:\Users\Nixill\.vscode-insiders\extensions\sumneko.lua-2.4.2\server/script/proto\converter.lua:132]: ...ions\sumneko.lua-2.4.2\server/script/proto\converter.lua:69: attempt to index a nil value (local 'state')
stack traceback:
	...ions\sumneko.lua-2.4.2\server/script/proto\converter.lua:132: in function 'proto.converter.unpackRange'
	...ns\sumneko.lua-2.4.2\server/script/provider\provider.lua:711: in function <...ns\sumneko.lua-2.4.2\server/script/provider\provider.lua:699>
	[C]: in function 'xpcall'
	...tensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:148: in function <...tensions\sumneko.lua-2.4.2\server/script/proto\proto.lua:123>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions