-
Hello everyone, I have defined custom assertions for busted which I use in my tests to make them more readable: assert.channel(nvim).at_position(0, 5).for_language('lua').has_extmarks() The problem is that the language server does not know that To make things more complicated in my case, I use busted to test Neovim plugins. For the test to work the test has to be run with Neovim as the Lua interpreter instead of whatever the
The custom assertions are defined to run inside the second Neovim. If anyone cares about how this tower of madness works, I have written a couple of blog posts:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I assume you're using the "workspace.library": [
"${addons}/busted/module/library",
"${3rd}/luassert/library"
], Then I tried to look at how the annotation of
Therefore one way to "fix" your warning, is by injecting your You may have another meta file in your project containing the following: ---@meta
---@class luassert.custom
local custom = {}
---@return table
function custom.channel(channel) end
---@class luassert: luassert.custom
Hope this helps 🙂 |
Beta Was this translation helpful? Give feedback.
I think I got it now. In the editor configuration I have set
runtime.path
to["lua/?.lua", "lua/?/init.lua"]
, because in Neovim Lua modules are stored in thelua
directory. However, this is not true for the addons and the custom meta file. Adding"?.lua"
to the.luarc.json
file does the trick.Finally no more yellow undercurls. …