LuaLS / LuaLS/lua-language-server
Workspace is loaded with fallback config then user config is partially loaded
まだ誰も着手していません。
- 主要言語
- Lua
- スター
- 4.4k
- フォーク
- 442
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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
Annotationsfolder 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
(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
- 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"]
}
}
- Open project with vscode
- See warning notification appear directly or upon opening main.lua file
- 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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
VS Code で .luarc.json、Annotations/table.d.lua、Lua/main.lua、Lua/bigfile.lua を使って動作を再現し、その後、読み込みシーケンスを確認するために添付されたログファイルを調べます。ユーザー設定の読み込み後も、Lua 5.4 のフォールバック定義と 500 KB の制限が有効なままになる理由を確認します。Lua 5.1 の設定が適用され、Annotations の定義が引き続き利用可能で、より大きなファイルが事前読み込みされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- lua
- 領域
- devtools, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100