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

Require paths not resolved when external library is loaded and using custom require path #2992

Open
sewbacca opened this issue Dec 15, 2024 · 0 comments

Comments

@sewbacca
Copy link
Contributor

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Windows

What is the issue affecting?

Completion, Hover, Libraries

Expected Behaviour

Hovering above lib should find lua/lib.lua.

Actual Behaviour

Hovering above lib yields 3 bytes, and only finds the path if either the file has not been loaded or no extra workspace library directory has been found.

Reproduction steps

  1. Setup the files:
-- lua/lib.lua
return {
	test = "hello"
}
-- cmd/test.lua
local lib = require 'lib'

assert(lib.test == "hello")
-- .luarc.json
{
	"runtime.path": [
		"lua/?.lua",
		"lua/?/init.lua"
	],
	"workspace.library": [
		"${3rd}/love2d/library"
	]
}
  1. Close NeoVim.
  2. Reopen NeoVim and open only the file cmd/test.lua
  3. Hover above lib and see bug.
  4. Open lua/lib.lua
  5. Go back to cmd/test.lua
  6. Completion is now available again.

Additional Notes

I could not reproduce this behaviour in VSCode.

Log File

Log file generated using the reproduction steps: https://pastebin.com/4VXMJjjB

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

1 participant