LuaLS / LuaLS/lua-language-server
[Feature Request] Named Environment/Configuration Selection
还没有人认领这个 Issue。
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 442
- PR 合并指标
- 30 天内没有已合并 PR
描述
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Libraries
Expected Behaviour
Not sure how best to word the title, but essentially, having different configuration names that the user can swap between would be nice. This is probably a really unlikely needed thing, but it's something I would need for my meta information.
Actual Behaviour
You can't specify some kind of named configuration.
Reproduction steps
N/A
Additional Notes
If you see https://github.com/LuaLS/lua-language-server/discussions/1834, I want to be able to differentiate between when certain functions exist/overload. The problem is that I can't really do that as-is, that I can tell at least. One thing I tried to look into were the configuration file details, but there's not a lot of documentation.
Ideally, I would be able to let the user specify how one of my variables is defined, e.g. love._console_name in my case would be 3DS, Switch or Wii U. I could then do something like so:
---@meta
---
---Provides access to information about the user's system.
---
---
---[Open in Browser](https://love2d.org/wiki/love.system)
---
---@class love.system
love.system = {}
if love._console_name == "3DS" then
local play_coins = 0
---Set the Play Coin count. \
---This function is **ONLY** available on _Nintendo 3DS_.
---@param coins integer
function love.system.setPlayCoins(coins)
play_coins = coins
end
---Get the Play Coin count. \
---This function is **ONLY** available on _Nintendo 3DS_.
---@return integer current_coins
function love.system.getPlayCoins()
return play_coins
end
end
return love.system
and it would only show these as defined when on a "3DS" configuration.
The C++ Visual Studio Code extension has something similar:

Log File
N/A
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定实现文件或测试。首先查看配置文档和讨论 1834,以了解如何通过命名配置选择条件定义;完成的标准是用户可以切换配置,并且只看到匹配的定义。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- lua, vscode
- 领域
- tooling
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100