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

Undefined global for builtins #1600

Closed
rebelot opened this issue Sep 29, 2022 · 7 comments
Closed

Undefined global for builtins #1600

rebelot opened this issue Sep 29, 2022 · 7 comments
Labels
Info Needed More information is required

Comments

@rebelot
Copy link

rebelot commented Sep 29, 2022

I'm having troubles with lua lsp recently. It seems that the lsp completely forgot about builtins, such as ipairs, tonumber, even table module and treats them as undefined globals.

I have sumneko configured as per lspconfig documentation to work with nvim runtime as a workspace library and this issue only happens for configuration files; everything works fine if I create a lua file anywhere outside nvim runtime path.

I haven't modified my config in months and everything used to work fine, what could have caused this?

lsp version is 3.5.6 (macports)

image

@sumneko
Copy link
Collaborator

sumneko commented Sep 30, 2022

Did you modified these configs:

  • Lua.runtime.meta
  • Lua.runtime.fileEncoding
  • Lua.runtime.builtin
  • Lua.workspace.supportScheme

@sumneko sumneko added the Info Needed More information is required label Sep 30, 2022
@sumneko
Copy link
Collaborator

sumneko commented Sep 30, 2022

Could you please provide your server log with debug level?
Or you can check if the log had something like this (need debug level):

[22:38:50.679][debug][#0:script\library.lua:242]: Builtin status:	builtin	default
[22:38:50.679][debug][#0:script\library.lua:266]: Meta path:	c:/Users/sumne/.vscode-insiders/extensions/vscode-lua/server/meta/Lua 5.4 zh-cn utf8/builtin.lua

@carsakiller
Copy link
Collaborator

These may help:

@rebelot
Copy link
Author

rebelot commented Sep 30, 2022

I did not modify those settings, however I was able to solve the issue by downloading the pre built binaries for macOS. I guess this is a problem with the macports release?

@sumneko
Copy link
Collaborator

sumneko commented Sep 30, 2022

Is the version you downloaded 3.5.6 Relase or the latest version in Github Actions?
Maybe it is broken in latest version and macports always using the latest version.

@rebelot
Copy link
Author

rebelot commented Sep 30, 2022

Latest from the release page worked fine, but idk when macports port was last updated

@sumneko
Copy link
Collaborator

sumneko commented Sep 30, 2022

Thanks for your reply, it seems that I don't need to trace this issue.

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

3 participants