LuaLS / LuaLS/lua-language-server
Lsp error in logs Unknown response id!
還沒有人認領這個 Issue。
- 主要語言
- Lua
- 星號
- 4.4k
- 分支
- 442
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Hi. I will appreciate any help.
Sometimes my server responds incorrectly. The server gives some responses eg.
{
_closeMessage = "Request cancelled.",
_closeReason = -32800,
id = 35,
jsonrpc = "2.0",
method = "textDocument/semanticTokens/range",
params = {
range = {
end = {
character = 0,
line = 0
},
start = {
character = 0,
line = 0
}
},
textDocument = {
uri = "---"
}
}
}
but the editor shows "workspace loading 0/0" or "Loading".
Even when it responds well, the same error appears in logs
[14:37:50.516][error][#0:script\proto\proto.lua:67]: Unknown response id! 0
stack traceback:
script\proto\proto.lua:67: in function 'proto.proto.response'
script\proto\proto.lua:195: in local 'f'
script\utility.lua:439: in metamethod 'close'
script\proto\proto.lua:202: in function <script\proto\proto.lua:175>
the difference is that when the server responds correctly, this appears in the logs:
[09:40:35.887][info] [#0:script\provider\diagnostic.lua:557]: Diagnostics scope ... (and here is my workspace folder)
however, when the server is working badly, the following appears in the logs:
[14:37:50.619][info] [#0:script\workspace\workspace.lua:282]: Scan files at: (and here are files from log/cache, not from my workspace I don.t know why.
Maybe someone faced such a problem?
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先重現 LSP 回應,並比較 script/proto/proto.lua:67、script/proto/proto.lua:195 和 script/workspace/workspace.lua:282 附近的日誌。追蹤回應為何會收到未知 ID,以及 workspace 掃描為何會使用日誌中記錄的快取檔案;完成的標準是能夠重現該故障,並驗證其原因和修正方案。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- lua
- 領域
- devtools
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100