LuaLS / LuaLS/lua-language-server
Any changes to the file tree are ignored
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
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
- Add a new file to your existing workspace with the following content:
---@class TestClass
local TestClass = {}
function TestClass.test()
end
return TestClass
- Save it and close the editor tab.
- Require this file into a local in some other, preexisting file.
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing LuaLS handling of workspace file-tree changes and the cached-file lifecycle implicated by the report. Reproduce the supplied add, save, close, and require sequence, then verify that diagnostics recognize the new or renamed file after it is closed without restarting VS Code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100