Skip to content

Busted addon doesn't set assert to luassert #3176

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

Open
brunotvs opened this issue May 7, 2025 · 0 comments
Open

Busted addon doesn't set assert to luassert #3176

brunotvs opened this issue May 7, 2025 · 0 comments

Comments

@brunotvs
Copy link

brunotvs commented May 7, 2025

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Windows WSL

What is the issue affecting?

Libraries

Expected Behaviour

Using busted and luassert addons should set the type for the builtin assert object to be luassert

Actual Behaviour

assert type still the simple function.

Reproduction steps

server settings:

  "workspace": {
    "checkThirdParty": 'Disable',
    "library": [
      "${addons}/luassert/module/library/",
      "${addons}/busted/module/library/"
    ]
  }

Additional Notes

I managed to locally fix by changing the busted addon from

assert = require("luassert")
spy = require("luassert.spy")
stub = require("luassert.stub")
mock = require("luassert.mock")

to

---@type luassert
assert = require("luassert")

---@type luassert.spy
spy = require("luassert.spy")

---@type luassert.stub
stub = require("luassert.stub")

---@type luassert.mock
mock = require("luassert.mock")

For some reason, the luals is not setting the correct type trhough the assignment done by the busted addon.

Log File

No response

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