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

unexpected undefined globals: string, error #5

Open
FelipeLema opened this issue Nov 13, 2024 · 8 comments
Open

unexpected undefined globals: string, error #5

FelipeLema opened this issue Nov 13, 2024 · 8 comments

Comments

@FelipeLema
Copy link

I create an isolated file with the following content

error(string.format("abc%d", 1))

and it complains

dev/undefined.lua|1 col 1| [Lua Diagnostics.](undefined-global):Undefined global `error`.
dev/undefined.lua|1 col 7| [Lua Diagnostics.](undefined-global):Undefined global `string`.
@CppCXY
Copy link
Collaborator

CppCXY commented Nov 14, 2024

Did the original LuaLS have this issue?

@FelipeLema
Copy link
Author

nope, just opened with original LuaLS and it recognizes string & error (even shows correct docs)

worth noting: I have lazydev plugin with {library={path = "luvit-meta/library", words = {"vim%.uv"}}} as config

@CppCXY
Copy link
Collaborator

CppCXY commented Nov 14, 2024

Maybe I need to update to the latest version, actually the current luals is only 3.11.

@CppCXY
Copy link
Collaborator

CppCXY commented Nov 14, 2024

If it is not a platform that luals cannot support, I recommend directly using the original luals. This repository does not provide any improvement over the original luals.

@FelipeLema
Copy link
Author

it's 64bit debian, btw

@CppCXY
Copy link
Collaborator

CppCXY commented Nov 22, 2024

Can you try the latest release version? It has been updated to 3.13.1 and maintains the same layout as luals.

@FelipeLema
Copy link
Author

it doesn't diagnose any errors in the isolated file now, but doing doc-symbol-at-point says it's a global undefined var. This is consistent with semantic tokens that show string and error as a variable, rather than a built-in

I tried in one of my neovim config files¹ and for (at least) string:

  • semantic token describes it as a regular var (not built-in)
  • documentation-at-point says it's a global, undefined var
  • diagnosed as an error that it's an undefined global (undefined-global), which doesn't happen in the isolated file

none of the above happen to vim, which is another built-in, provided by lazydev

¹: that means I'm using https://github.com/folke/lazydev.nvim

@CppCXY
Copy link
Collaborator

CppCXY commented Nov 29, 2024

I realized I forgot to include a debugger.lua file.

I'll take a look at it later. I'm mainly busy with language server development and only spend some time on this project on Fridays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants