LuaLS / LuaLS/lua-language-server

[Feature Request] Named Environment/Configuration Selection

Abierto
#1,957 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

enhancement
Lenguaje dominante
Lua
Estrellas
4.4k
Forks
442
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

No se nombra ningún archivo de implementación ni ninguna prueba. Empieza revisando la documentación de configuración y la discusión 1834 para entender cómo podrían seleccionarse definiciones condicionales mediante una configuración con nombre; estaría terminado cuando los usuarios puedan cambiar de configuración y ver solo las definiciones correspondientes.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
lua, vscode
Área
tooling
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.