LuaLS / LuaLS/lua-language-server

Any changes to the file tree are ignored

オープン
#2,234 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug filewatch
主要言語
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?

Annotations, Type Checking, Completion, Diagnostics/Syntax Checking, Hover

Expected Behaviour

When you make any changes to the workspace's file tree (e.g. add a new file, rename a file), LuaLS becomes aware of them.

Actual Behaviour

New/renamed files are only recognized so long as they are open in the editor and completely forgotten about once closed.

Reproduction steps
  1. Add a new file to your existing workspace with the following content:
---@class TestClass
local TestClass = {}

function TestClass.test()
end

return TestClass
  1. Save it and close the editor tab.
  2. Require this file into a local in some other, preexisting file.
  3. Observe that the local is of unknown type.
Additional Notes

Re-running diagnostics doesn't fix this. The only workaround I have found is to completely restart VSCode.

From my limited understanding of LuaLS code, I think it has something to do with cached files. And there is no way to discard and rebuild the cache without exiting VSCode that I could find.

Log File

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、LuaLS による workspace file-tree の変更処理と、報告で問題になっている cached-file のライフサイクルを追跡します。提示された add、save、close、require のシーケンスを再現し、その後、VS Code を再起動せずに、ファイルを閉じた後も diagnostics が新規または名前変更されたファイルを認識することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
lua, vscode
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。