-
Notifications
You must be signed in to change notification settings - Fork 514
Show formatting status in status bar #461
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
Conversation
* AnimatedStatusBarItem now implements vscode.StatusBarItem interface * setAnimatedStatusBarMessage methods provides a simple way of creating an animated status message
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.
Couple small things to fix, but over all the code looks good.
return animatedStatusBarItem; | ||
} | ||
|
||
class AnimatedStatuBarItem implements StatusBarItem { |
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.
Slight typo, should be AnimatedStatusBarItem
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.
fixed.
this.statusBarItem.dispose(); | ||
} | ||
|
||
_updateCounter(): void { |
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.
TypeScript has 'private' visibility, you should use that instead of the underscore naming convention
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.
fixed.
return this.executeRulesInOrder(document, range, options, 0); | ||
|
||
let textEdits: Thenable<TextEdit[]> = this.executeRulesInOrder(document, range, options, 0); | ||
AnimatedStatusBar.setAnimatedStatusBarMessage("formatting", textEdits); |
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.
I'd recommend a more obvious string like "PowerShell code formatting in progress"
I just realized why you used "formatting" as the status bar string, because it's a status bar item. Maybe call it "Formatting file"? |
It looks like the normal status bar text, I think it's fine to be a bit longer. I can make the change. |
The gif rendering here is a bit messed up I think. I am planning on adding a few more options like these dots, e.g a spinning wheel. I can check in the longer status when I make the change. |
I think we can wait on other animation options for now :) Bigger priority is getting the formatting stability fix checked in so that we can get a patch update out soon. I'm going to make a PR in a sec with the text change plus a couple other things. |
Yes, of course, stability is more important! and I have been testing it in my branch since last weekend. But the fix doesn't work. The biggest problem is the irregular nature of the bug. It appears a bit hard to reproduce. I will send in a patch soon for that too! |
Awesome, thanks for working on that! |
Sometimes, formatting gets blocked by ongoing PSSA invocations and there is no way to know if the extension is formatting the document or not. This addition allows us to show an animated status to indicate formatting status.