Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dljsjr opened this issue Apr 22, 2024 · 0 comments

Comments

@dljsjr
Copy link

dljsjr commented Apr 22, 2024

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 as git checkout <branch>

Reproduction steps

  1. Make sure Runtime Path includes ?.lua;?/init.lua
  2. Create a module at foo.lua, populate it with working Lua code.
  3. Create a new git branch
  4. Refactor foo.lua to foo/init.lua
  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant