LuaLS / LuaLS/lua-language-server

Workspace is loaded with fallback config then user config is partially loaded

Abierto
#3,092 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

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?

Linux

What is the issue affecting?

Other

Expected Behaviour

Upon opening a project when LuaLS is loading if the user have a .luarc.json with content :

{
  "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
  "runtime": {
    "version": "Lua 5.1",
    "fileEncoding": "utf8",
    "builtin": {
      "basic": "disable",
      "bit": "disable",
      "bit32": "disable",
      "builtin": "disable",
      "coroutine": "disable",
      "debug": "disable",
      "ffi": "disable",
      "io": "disable",
      "jit": "disable",
      "math": "disable",
      "os": "disable",
      "package": "disable",
      "string": "disable",
      "table": "disable",
      "table.clear": "disable",
      "table.new": "disable",
      "utf8": "disable"
    }
  },
  "workspace": {
    "maxPreload": 2048,
    "library": ["Annotations"]
  }
}

The language server should :

  • Not prepare any hover documentation for any standard lua library
  • Preload files that exceed 500kb
  • Read definitions files from Annotations folder create entries for hover documentations.
Actual Behaviour

Upon opening the project LuaLS will :

In the case of hover documentations :
LuaLS will prepare all lua 5.4 documentation and start serving them. When definitions files in Annotations if one define for example table.foreach the documentation will be added to the current context
Image
(first documentation block come from Annotations, second come from LuaLS embedded definitions files for the standard libraries for lua 5.4)

In the case there is an 500+ kb file display directly :
Too large file: Lua/bigfile.lua skipped. The currently set size limit is: 500 KB, and the file size is: 627.979 KB.
(Upon opening Lua/bigfile.lua the file will be treated correctly without any error)

Reproduction steps
  1. Create a project folder with content as follow :
root-directory/
  - Annotations/
    - table.d.lua
  - Lua/
    - main.lua
    - bigfile.lua
  - .luarc.json

table.d.lua content :

---@meta table

---@class tablelib
table = {}

---
---Deprecated in favor of pairs
---@see pairs
---
---[View documents](http://www.lua.org/manual/5.4/manual.html#pdf-table.foreach)
---
---@generic T
---@param list any
---@param callback fun(key: string, value: any):T|nil
---@return T|nil
---@deprecated
function table.foreach(list, callback) end

main.lua content:

local t = {}
table.foreach(t, function ()
    
end)

bigfile.lua content : Anything to make the file be bigger than 500kb

.luarc.json content

{
  "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
  "runtime": {
    "version": "Lua 5.1",
    "fileEncoding": "utf8",
    "builtin": {
      "basic": "disable",
      "bit": "disable",
      "bit32": "disable",
      "builtin": "disable",
      "coroutine": "disable",
      "debug": "disable",
      "ffi": "disable",
      "io": "disable",
      "jit": "disable",
      "math": "disable",
      "os": "disable",
      "package": "disable",
      "string": "disable",
      "table": "disable",
      "table.clear": "disable",
      "table.new": "disable",
      "utf8": "disable"
    }
  },
  "workspace": {
    "maxPreload": 2048,
    "library": ["Annotations"]
  }
}
  1. Open project with vscode
  2. See warning notification appear directly or upon opening main.lua file
  3. Hover above striked table.foreach and see both documentation aggregated together
Additional Notes

This behavior can also be reproduced in current zed stable version 0.174.6
In both editor I only installed the extension and run the default provided configuration. I only configured misc.parameters : [ "--loglevel=trace" ] in vscode settings only for the following logs as misc.parameters in .luarc.json was not picked-up.

Log File

file_home_skyy_Workspace_issue.log
service.log

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

Reproduzca el comportamiento con .luarc.json, Annotations/table.d.lua, Lua/main.lua y Lua/bigfile.lua en VS Code y, después, revise los archivos de registro adjuntos para comprobar la secuencia de carga. Compruebe por qué las definiciones de reserva de Lua 5.4 y el límite de 500 KB siguen activos después de que se cargue la configuración del usuario. Se considera terminado cuando se aplican los ajustes de Lua 5.1, las definiciones de Annotations siguen disponibles y el archivo más grande se precarga.

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

Evaluación

Stack tecnológico
lua
Área
devtools, tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.