LuaLS / LuaLS/lua-language-server

[Feature Request] Named Environment/Configuration Selection

Offen
#1,957 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement
Vorherrschende Sprache
Lua
Sterne
4.4k
Forks
442
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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:
image

Log File

N/A

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Es wird keine Implementierungsdatei und kein Test genannt. Beginne damit, die Konfigurationsdokumentation und Diskussion 1834 zu prüfen, um zu verstehen, wie bedingte Definitionen durch eine benannte Konfiguration ausgewählt werden könnten; abgeschlossen wäre die Arbeit, wenn Benutzer zwischen Konfigurationen wechseln können und nur die passenden Definitionen sehen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua, vscode
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.