Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

语义token报错 #1886

Closed
CppCXY opened this issue Feb 7, 2023 · 3 comments
Closed

语义token报错 #1886

CppCXY opened this issue Feb 7, 2023 · 3 comments
Labels
Info Needed More information is required

Comments

@CppCXY
Copy link
Collaborator

CppCXY commented Feb 7, 2023

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

可以报告错误,但是语言服务本身处理不要报错

Actual Behaviour

怎么要填这么多啊

Reproduction steps

当文件内的local过多出现PARSER_LOCAL_LIMIT错误时(这个错误报了非常非常多,而且位置也是错的)
很容易出现错误

Additional Notes

No response

Log File

Can not compile nil source
stack traceback:
script\vm\compiler.lua:1897: in function 'vm.vm.compileNode'
script\vm\compiler.lua:1288: in function <script\vm\compiler.lua:1281>
(...tail calls...)
script\vm\compiler.lua:1820: in upvalue 'compileByNode'
script\vm\compiler.lua:1910: in function 'vm.vm.compileNode'
script\vm\infer.lua:256: in function 'vm.vm.getInfer'
script\core\semantic-tokens.lua:35: in function <script\core\semantic-tokens.lua:14>
(...tail calls...)
script\core\semantic-tokens.lua:856: in local 'callback'
script\parser\guide.lua:688: in function 'parser.guide.eachSourceBetween'
script\core\semantic-tokens.lua:855: in function 'core.semantic-tokens'
script\provider\provider.lua:1113: in function <script\provider\provider.lua:1101>
[C]: in function 'xpcall'
script\proto\proto.lua:191: in function <script\proto\proto.lua:166>
script\vm\node.lua:414: table index is nil
stack traceback:
script\vm\node.lua:414: in function 'vm.vm.setNode'
script\vm\compiler.lua:1907: in function 'vm.vm.compileNode'
script\vm\compiler.lua:1288: in function <script\vm\compiler.lua:1281>
(...tail calls...)
script\vm\compiler.lua:1820: in upvalue 'compileByNode'
script\vm\compiler.lua:1910: in function 'vm.vm.compileNode'
script\vm\infer.lua:256: in function 'vm.vm.getInfer'
script\core\semantic-tokens.lua:35: in function <script\core\semantic-tokens.lua:14>
(...tail calls...)
script\core\semantic-tokens.lua:856: in local 'callback'
script\parser\guide.lua:688: in function 'parser.guide.eachSourceBetween'
script\core\semantic-tokens.lua:855: in function 'core.semantic-tokens'
script\provider\provider.lua:1113: in function <script\provider\provider.lua:1101>
[C]: in function 'xpcall'
script\proto\proto.lua:191: in function <script\proto\proto.lua:166>
[Error - 10:12:50 AM] Request textDocument/semanticTokens/range failed.
Message: [10:12:50.764][error][#0:script\vm\node.lua:414]: script\vm\node.lua:414: table index is nil
stack traceback:
script\vm\node.lua:414: in function 'vm.vm.setNode'
script\vm\compiler.lua:1907: in function 'vm.vm.compileNode'
script\vm\compiler.lua:1288: in function <script\vm\compiler.lua:1281>
(...tail calls...)
script\vm\compiler.lua:1820: in upvalue 'compileByNode'
script\vm\compiler.lua:1910: in function 'vm.vm.compileNode'
script\vm\infer.lua:256: in function 'vm.vm.getInfer'
script\core\semantic-tokens.lua:35: in function <script\core\semantic-tokens.lua:14>
(...tail calls...)
script\core\semantic-tokens.lua:856: in local 'callback'
script\parser\guide.lua:688: in function 'parser.guide.eachSourceBetween'
script\core\semantic-tokens.lua:855: in function 'core.semantic-tokens'
script\provider\provider.lua:1113: in function <script\provider\provider.lua:1101>
[C]: in function 'xpcall'
script\proto\proto.lua:191: in function <script\proto\proto.lua:166>

Code: -32603
Can not compile nil source
stack traceback:
script\vm\compiler.lua:1897: in function 'vm.vm.compileNode'
script\vm\compiler.lua:1288: in function <script\vm\compiler.lua:1281>
(...tail calls...)
script\vm\compiler.lua:1820: in upvalue 'compileByNode'
script\vm\compiler.lua:1910: in function 'vm.vm.compileNode'
script\vm\infer.lua:256: in function 'vm.vm.getInfer'
script\core\semantic-tokens.lua:35: in function <script\core\semantic-tokens.lua:14>
(...tail calls...)
script\core\semantic-tokens.lua:856: in local 'callback'
script\parser\guide.lua:688: in function 'parser.guide.eachSourceBetween'
script\core\semantic-tokens.lua:855: in function 'core.semantic-tokens'
script\provider\provider.lua:1113: in function <script\provider\provider.lua:1101>
[C]: in function 'xpcall'
script\proto\proto.lua:191: in function <script\proto\proto.lua:166>
script\vm\node.lua:414: table index is nil
stack traceback:
script\vm\node.lua:414: in function 'vm.vm.setNode'
script\vm\compiler.lua:1907: in function 'vm.vm.compileNode'
script\vm\compiler.lua:1288: in function <script\vm\compiler.lua:1281>
(...tail calls...)
script\vm\compiler.lua:1820: in upvalue 'compileByNode'
script\vm\compiler.lua:1910: in function 'vm.vm.compileNode'
script\vm\infer.lua:256: in function 'vm.vm.getInfer'
script\core\semantic-tokens.lua:35: in function <script\core\semantic-tokens.lua:14>
(...tail calls...)
script\core\semantic-tokens.lua:856: in local 'callback'
script\parser\guide.lua:688: in function 'parser.guide.eachSourceBetween'
script\core\semantic-tokens.lua:855: in function 'core.semantic-tokens'
script\provider\provider.lua:1113: in function <script\provider\provider.lua:1101>
[C]: in function 'xpcall'
script\proto\proto.lua:191: in function <script\proto\proto.lua:166>
[Error - 10:12:51 AM] Request textDocument/semanticTokens/range failed.
Message: [10:12:51.232][error][#0:script\vm\node.lua:414]: script\vm\node.lua:414: table index is nil
stack traceback:
script\vm\node.lua:414: in function 'vm.vm.setNode'
script\vm\compiler.lua:1907: in function 'vm.vm.compileNode'
script\vm\compiler.lua:1288: in function <script\vm\compiler.lua:1281>
(...tail calls...)
script\vm\compiler.lua:1820: in upvalue 'compileByNode'
script\vm\compiler.lua:1910: in function 'vm.vm.compileNode'
script\vm\infer.lua:256: in function 'vm.vm.getInfer'
script\core\semantic-tokens.lua:35: in function <script\core\semantic-tokens.lua:14>
(...tail calls...)
script\core\semantic-tokens.lua:856: in local 'callback'
script\parser\guide.lua:688: in function 'parser.guide.eachSourceBetween'
script\core\semantic-tokens.lua:855: in function 'core.semantic-tokens'
script\provider\provider.lua:1113: in function <script\provider\provider.lua:1101>
[C]: in function 'xpcall'
script\proto\proto.lua:191: in function <script\proto\proto.lua:166>

Code: -32603

@sumneko
Copy link
Collaborator

sumneko commented Feb 7, 2023

请提供一下演示代码

@sumneko sumneko added the Info Needed More information is required label Feb 7, 2023
@CppCXY
Copy link
Collaborator Author

CppCXY commented Feb 7, 2023

123.zip
通过随机编辑滚动编辑,就有可能触发

@CppCXY
Copy link
Collaborator Author

CppCXY commented Feb 7, 2023

而且在出现相关错误后,所有诊断都不再刷新,
image

sumneko added a commit that referenced this issue Feb 7, 2023
sumneko added a commit that referenced this issue Feb 7, 2023
sumneko added a commit that referenced this issue Feb 7, 2023
@sumneko sumneko closed this as completed in 54985b6 Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Info Needed More information is required
Projects
None yet
Development

No branches or pull requests

2 participants