Plenary's global `busted` definitions get picked up by LuaLS
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start by locating Plenary's bundled busted implementation and the global assignments it exposes, then reproduce how LuaLS indexes those definitions. Decide on a solution that prevents the bundled globals from being selected while preserving existing plugin behavior; done means real busted definitions are used for navigation without breaking Plenary tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello.
Plenary has its own implementation of busted, and just like the real busted it defines a bunch of global variables. This is a problem when using LuaLS because these definitions will be added to the global namespace even if I never require their source file because LuaLS sees a global assignment and adds the variable regardless of whether the file is ever sourced. I use the real busted for my tests, so this means that jumping to the definition will jump to the wrong functions.
How can we fix this? I can think of two solutions:
- Use string variables and indices to assign to
_G, i.e. instead ofdescribe = mod.describeuselocal name = 'describe'; _G[name] = mod.describe, this will stop the language server from adding the definition. - Move the plenary busted functionality to a separate plugin that plugin authors can
packaddbefore running tests. Then I don't have to install the plenary busted plugin and everything is fine.
Personally I think the second option would be better because it does not disrupt any existing plugins that depend on it, but it is a bit uglier in the code. What do you think? Any other idea?
- Lenguaje dominante
- Lua
- Estrellas
- 3.5k
- Forks
- 340
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nvim-lua/plenary.nvim
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
nvim-lua/plenary.nvim#682 ·
-
uniform usage of `os.getenv` Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
nvim-lua/plenary.nvim#680 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
nvim-lua/plenary.nvim#675 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
nvim-lua/plenary.nvim#672 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
nvim-lua/plenary.nvim#671 · 1 comentario ·
Todos los issues de nvim-lua/plenary.nvim
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
HenrikBengtsson/CBI-software#134 ·
-
Nmap
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
secondlife/slua#96 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100