LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.38k stars 319 forks source link

Library file skipped due to size limit. #909

Closed twoco closed 2 years ago

twoco commented 2 years ago

I cannot use the love2d library due to file size limit of love.graphics.

I use the Lua extention with this config:

{
  "Lua.runtime.version": "LuaJIT",
  "Lua.diagnostics.globals": ["love", "lldebugger"],
  "Lua.workspace.library": ["${3rd}/love2d/library"],
  "Lua.workspace.checkThirdParty": false
}

But I get errors / warnings that graphics does not exist on love. But e.g. love.audio works. What's wrong?

image

.vscode\extensions\sumneko.lua-2.6.0\server\meta\3rd\love2d\library\love.lua

On vs code restart I get a notification:

.vscode\extensions\sumneko.lua-2.6.0\server\meta\3rd\love2d\library\love.graphics.lua skipped. The currently set size limit is: 100 KB, and the file size is: 139.979 KB.

Is this just a setting that needs editing or a technical / fixed limit? From this extention or vscode itself?

src: https://github.com/sumneko/lua-language-server/blob/2.6.0/script/files.lua#L456

twoco commented 2 years ago

Fixed by setting: "Lua.workspace.preloadFileSize": 1000 src Consider to set default to e.g. 200 kb? And / or make a note of it in the documentation / getting started.

miversen33 commented 2 years ago

I agree with @twoco, this should really be something that is documented as when the size limit is reached, the language server does not provide complete functionality. While that is fine, documenting how to update the size limit is important. Users should not be expected to search the source code to establish how to set this