-
Notifications
You must be signed in to change notification settings - Fork 180
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
Language Status indicator #1547
Conversation
This sets a busy status when finding out the terraform version, which approximates a loading status for the extension because the request for status happens after all the other requests happen "in the background". So, we get a loading bar for the extension in the lower right hand corner. We could make this a statusbarItem instead for better visibility and/or discoverability.
Repointed to main instead of experimental #1540 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That why I said this approximates not is a loading status indicator. We have a busy indicator for terraform-ls by using client.onDidChangeState, but since terraform-ls returns The request for the terraform version resolution is queued behind all the other work we initiate at start and returns when most of that is finished. This simulates terraform-ls still being 'busy' by having the busy indicator set for both terraform-ls status and the terraform version. This means all three are busy at the same time, but more accurately portrays the current status of terraform-ls. I could have not set the terraform version as busy and left it blank until it's filled, and only set terraform-ls to busy. This would be only one busy icon, so would be less moving parts. But, I think this leaves the state of the terraform version confusing, is it blank because we couldn't find it or because we're still waiting? A more accurate implementation could have terraform-ls not return initialized until it has finished the background jobs, which would make the client.onDidChangeState show busy until it was ready. This would require some significant changes to initialization of terraform-ls. Another accurate implementation would utilize the custom request functionality to have the client send a request to terraform-ls asking about it's status. The scheduler can return how many jobs are pending and we can use that to update the busy indicator. This would require less changes than changing initialization, but still is a bigger lift than this PR. We had time for this approximation right now. |
Co-authored-by: Daniel Banck <dbanck@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 That makes sense. Appreciate the additional context!
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This sets a busy status when finding out the terraform version, which approximates a loading status for the extension because the request for status happens after all the other requests happen "in the background". So, we get a loading bar for the extension in the lower right hand corner.
Screen.Recording.2023-07-20.at.1.23.37.PM.mov