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

Code completion crashed #1978

Closed
chrisniael opened this issue Mar 3, 2023 · 0 comments
Closed

Code completion crashed #1978

chrisniael opened this issue Mar 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@chrisniael
Copy link

chrisniael commented Mar 3, 2023

Which OS are you using?

Windows

Expected Behaviour

When typing for, VSCode would popup completion list like this:

image

Actual Behaviour

There are no popups and there are an error notification.

image

image

Reproduction steps

  1. Config VSCode

    • Text Editor - Files: Associations

      Item Value
      *.bytes lua
    • Extensions - Lua > Runtime: Path

      • ?.lua
      • ?/init.lua
      • Common/?.bytes
  2. Create an example project, file tree like this:

    │  main.lua
    │
    └─Common
            enum.bytes
    

    main.lua

    local a = require("enum")
    print(a)

    Common/enum.bytes

    return {
        name = "zhangsan"
    }
  3. Change something of file enum.bytes (this is very important for reproducing this bug!), for example:

    Common/enum.bytes

    return {
        name = "zhangsan",
        age = 21
    }
  4. Type for in main.lua, wait VSCode do completion.

Additional Notes

No response

Log

script\core\completion\auto-require.lua:61: attempt to index a nil value
stack traceback:
	script\core\completion\auto-require.lua:61: in function 'core.completion.auto-require.check'
	script\core\completion\completion.lua:407: in upvalue 'checkModule'
	script\core\completion\completion.lua:1457: in upvalue 'tryWord'
	script\core\completion\completion.lua:2231: in upvalue 'tryCompletions'
	script\core\completion\completion.lua:2247: in function 'core.completion.completion.completion'
	script\provider\provider.lua:622: in function <script\provider\provider.lua:597>
	[C]: in function 'xpcall'
	script\proto\proto.lua:191: in function <script\proto\proto.lua:166>
[Error - 2:10:13 PM] Request textDocument/completion failed.
@carsakiller carsakiller transferred this issue from LuaLS/vscode-lua Mar 4, 2023
@sumneko sumneko added the bug Something isn't working label Mar 6, 2023
@sumneko sumneko closed this as completed in 765c926 Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants