LuaLS / LuaLS/lua-language-server

[Feature Request] Named Environment/Configuration Selection

未關閉
#1,957 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

enhancement
主要語言
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:

```lua
---@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:
![image](https://user-images.githubusercontent.com/6239208/221932378-3aa4c93f-92eb-4f61-afaf-1b07d4bc3732.png)

### Log File

N/A

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

未指定實作檔案或測試。首先查看組態文件和討論 1834,以了解如何透過命名組態選取條件定義;完成的標準是使用者可以切換組態,並且只看到相符的定義。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
lua, vscode
領域
tooling
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。