You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Diagnostics can become stale when switching between <module>.lua and <module>/init.lua structures (such as when going back and forth between git branches)
#2625
Diagnostics should always be performed on the current version of a module that is on disk.
Actual Behaviour
When switching between two different ways of structuring the same module as described in the title, diagnostics can populate the Problems panel in VS Code with information about the version of the module that was on-disk before switching using a mechanism such as git checkout <branch>
Reproduction steps
Make sure Runtime Path includes ?.lua;?/init.lua
Create a module at foo.lua, populate it with working Lua code.
Create a new git branch
Refactor foo.lua to foo/init.lua
Various diagnostics will show up in the VS Code Problems Panel, such as duplicate definitions, missing annotations, etc. It almost looks like the LSP is trying to process both files at the same time.
Additional Notes
No response
Log File
I won't be able to provide logs as this is a proprietary codebase. Apologies.
The text was updated successfully, but these errors were encountered:
I think that this is slightly different from what I originally reported.
What actually seems to be happening is that git operations that change the file on disk can somehow lead a different version of the file remaining in the list of files that the language server is operating on.
This file will have a file system path that includes the git commit as an element.
The result is that you get collisions, or you get diagnostics for a version of the file that's no longer in your working copy. Next time it happens, I'll provide more information.
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?
Diagnostics/Syntax Checking
Expected Behaviour
Diagnostics should always be performed on the current version of a module that is on disk.
Actual Behaviour
When switching between two different ways of structuring the same module as described in the title, diagnostics can populate the
Problems
panel in VS Code with information about the version of the module that was on-disk before switching using a mechanism such asgit checkout <branch>
Reproduction steps
Runtime Path
includes?.lua;?/init.lua
foo.lua
, populate it with working Lua code.git
branchfoo.lua
tofoo/init.lua
Additional Notes
No response
Log File
I won't be able to provide logs as this is a proprietary codebase. Apologies.
The text was updated successfully, but these errors were encountered: