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 updated for all files on changes #1603

Open
rchl opened this issue Jan 29, 2024 · 2 comments
Open

Diagnostics updated for all files on changes #1603

rchl opened this issue Jan 29, 2024 · 2 comments

Comments

@rchl
Copy link

rchl commented Jan 29, 2024

Language Server Version

v0.32.6

Terraform Version

Terraform v1.0.4 on darwin_arm64

Client Version

Sublime LSP 1.28.0

Behavior

I don't know if this causes any performance issue but I've noticed this non-ideal behavior when checking out some slowness...

I've noticed that the server reports diagnostics for all files in the workspace on every change, even if the diagnostic state doesn't change for given files.

Screenshot 2024-01-29 at 12 12 45

I think that there is a potential for optimization here - it could keep the state of diagnostics internally and only report when there are any changes since the last update.

Steps to Reproduce

  • Open any project with multiple terraform files
  • Change any file
  • Observer server logs

Terraform Configuration

No response

Project Structure

No response

Gist

No response

References

No response

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@rchl rchl added the performance Gotta go fast label Jan 29, 2024
@dbanck
Copy link
Member

dbanck commented Feb 5, 2024

Hi @rchl!

Thanks for the report. I agree, it's not ideal and can be improved.
In my tests I only saw diagnostics for files of the same module (directory), not the whole workspace.

I can't see the full paths in your screenshot, but I assume this is a module with many files?

@rchl
Copy link
Author

rchl commented Feb 5, 2024

It might be that it's just the module (directory). We have just a flat structure with all files in the same directory.

Also seems like diagnostics are only reported when at least one file has some diagnostic reported. As soon as none of the files have any reported diagnostics then no diagnostics are published on changes.

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

No branches or pull requests

2 participants