Feature Request: Add an option to require type annotations
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 42/100
Línea de trabajo
Comienza con la configuración .luarc.json y los diagnósticos existentes incomplete-signature-doc, missing-global-doc y missing-local-export-doc para entender cómo se habilitan y escalan los diagnósticos. Define el alcance del nuevo diagnóstico para funciones, variables de tabla globales y anotaciones de tabla; después, valida el comportamiento solicitado de advertencia y error con los ejemplos del issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Desire
I would like a way for lua-language-server to apply a "strict" mode to the functions and tables variables of lua files. e.g. if a function takes at least one parameter or has at least one return <foo> statement, it would error if that function doesn't also have a ---@param / ---@return statement to match it.
Issue
There seems to be some arguments that can make lua-language-server more strict, for example these:
.luarc.json
{
"diagnostics": {
"neededFileStatus": {
"incomplete-signature-doc": "Any",
"missing-global-doc": "Any",
"missing-local-export-doc": "Any"
},
"severity": {
"incomplete-signature-doc": "Error",
"missing-global-doc": "Error",
"missing-local-export-doc": "Error"
}
},
}
But they seem to activate only on inlined functions or functions that have incomplete documentation. So if a function has no docs at all, it gets skipped.
Suggestion
A new diagnostic that maybe can be a warning but can be escalated to an error. And it basically says
- If it is a global variable table, it needs a
---@type - If it is a function
- And it has at least one parameter
- Each parameter must define
---@paramwith a name + type
- Each parameter must define
- And it has at least one non-bare-return `return
- Each parameter must define
---@returnwith type
- Each parameter must define
- And it has at least one parameter
- If the type annotation is a table
- Require that the table is "filled out" with concrete types. e.g.
---@type table->---@type table<string, integer>
- Require that the table is "filled out" with concrete types. e.g.
Something along these lines
- Lenguaje dominante
- Lua
- Estrellas
- 4.4k
- Forks
- 442
- Merge medio
- 8 d 9 h
- PR fusionados (30 d)
- 1
Guía de contribución
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 LuaLS/lua-language-server
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
LuaLS/lua-language-server#1776 ·
-
泛型for迭代器的类型推导漏掉了带__call的类 Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
LuaLS/lua-language-server#3463 · 5 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
LuaLS/lua-language-server#3461 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
LuaLS/lua-language-server#3460 · 1 comentario · 1 reacción ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
LuaLS/lua-language-server#3459 · 1 reacción ·
Todos los issues de LuaLS/lua-language-server
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
LandSandBoat/server#11579 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ArchiveTeam/sinavideo-grab#7 · 3 reacciones ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mailcow/mailcow-dockerized#7480 ·
-
Mapper: a failed area image export crashes Mudlet if the profile closed while it was running Abiertomapper bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
documentation feature-request mini.completion
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100