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

Issue with workspace detection when generating files during VSCode startup #1640

Closed
jotakob opened this issue Oct 18, 2022 · 1 comment
Closed
Labels
bug Something isn't working
Milestone

Comments

@jotakob
Copy link

jotakob commented Oct 18, 2022

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

In my workspace, I use a custom script that runs when I start VSCode and (re-)generates a bunch of LUA Meta files that contain an API I use. However, because this happens at the same time as the lua language server analyzes the workspace the two processes conflict somehow, leading to the language server not properly analyzing these files, and listing a lot of "undefined global" problems as a result. Even if the langauge server later re-analyzes the workspace as I'm working, these problems do not go away. Regenerating the files again later also does not fix the issue.

I expect the language server to re-analyze the files after they are generated to properly compile the list of globals etc, alternatively I think my problem could also be solved by adding a command that I can call to force the language server to reanalyze the entire workspace, which I could call after the files are generated, or a config value to delay the inital analysis of the workspace by a few seconds.

Actual Behaviour

The language server does not find the generated Meta files and instead lists a lot of "undefined global" issues that don't go away.

This is not consistent, when restarting VSCode it only happens around 50% of the time.

Reproduction steps

  1. Start VSCode with the workspace
  2. Wait for the Meta files to be generated
  3. Wait for the LUA langauge server to finish analyzing
  4. Notice a large number of issues raised in the Problem panel

Additional Notes

This is on version 3.5.5 btw, because 3.5.6 frequently breaks the code colour formatting.

Log File

No response

@sumneko sumneko added the bug Something isn't working label Oct 22, 2022
@sumneko sumneko added this to the 3.6.0 milestone Oct 22, 2022
@jotakob
Copy link
Author

jotakob commented May 15, 2023

I re-tested this in 3.6.19 and the problem still exists :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants