Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

incorrect 3rd package function signature #3231

Answered by tomlau10
lxl66566 asked this question in Q&A
Discussion options

Here's my workspace config:

{
 "Lua.runtime.version": "LuaJIT",
 "Lua.diagnostics.globals": ["ngx", "lfs"],
 "Lua.workspace.library": ["${3rd}/OpenResty/library", "${3rd}/lfs/library"]
}

when I use openresty's function, I found there's an incorrect function signature: set_resp_header should have 4 params, but lsp's has none.

In the function definition file C:/Users/me/.vscode/extensions/sumneko.lua-3.15.0-win32-x64/server/meta/3rd/OpenResty/library/resty/core/response.lua, the content is below:

---@meta
local resty_core_response = {}
function resty_core_response.set_resp_header() end
resty_core_response.version = require("resty.core.base").version
return resty_core_response

That's inconsist with the definition in LuaCATS/openresty, which is the upstream of 3rd/Openresty.

You must be logged in to vote

AFAIK, the server built-in 3rd party library is deprecated long ago: #1950
(this is actually a pinned discussion in the discussion page 🙈 )

You will need to use the LLS addon manager to download / install library, and link to them using

 "workspace.library": [
 "${addons}/openresty/module/library"
 ],

(the addon manager will auto adjust your project's .luarc.json when you install the library)


but ...

Even if I added OpenResty library in this way, still the cloned library is the old version 😕


I then opened the submodule at my LLS addon path, seems that the submodule commit is not updated in the LLS-addon registry repo 🤔
https://github.com/LuaLS/LLS-Addons/tree/main/addons/op...

Replies: 2 comments 1 reply

Comment options

And there's a lot of wrong signatures in github: code search result.

You must be logged in to vote
0 replies
Comment options

AFAIK, the server built-in 3rd party library is deprecated long ago: #1950
(this is actually a pinned discussion in the discussion page 🙈 )

You will need to use the LLS addon manager to download / install library, and link to them using

 "workspace.library": [
 "${addons}/openresty/module/library"
 ],

(the addon manager will auto adjust your project's .luarc.json when you install the library)


but ...

Even if I added OpenResty library in this way, still the cloned library is the old version 😕
image


I then opened the submodule at my LLS addon path, seems that the submodule commit is not updated in the LLS-addon registry repo 🤔
https://github.com/LuaLS/LLS-Addons/tree/main/addons/openresty
=> it is still pointing to an old commit: https://github.com/LuaCATS/openresty/tree/cc15b6401f553756e44e7ebdade7f4a382079521
maybe someone need to open PR and update it in the registry first

You must be logged in to vote
1 reply
Comment options

Thank you for your excellent answer! I tried to open a PR for it.

Answer selected by lxl66566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /