Skip to content

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

Merged
merged 7 commits into from
Jan 25, 2017
Merged

Conversation

kapilmb
Copy link

@kapilmb kapilmb commented Jan 25, 2017

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.

Kapil Borle added 5 commits January 20, 2017 16:42
* AnimatedStatusBarItem now implements vscode.StatusBarItem interface
* setAnimatedStatusBarMessage methods provides a simple way of creating an animated status message
Copy link
Contributor

@daviwil daviwil left a 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 {
Copy link
Contributor

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

Copy link
Author

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 {
Copy link
Contributor

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

Copy link
Author

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);
Copy link
Contributor

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"

@daviwil
Copy link
Contributor

daviwil commented Jan 25, 2017

I just realized why you used "formatting" as the status bar string, because it's a status bar item. Maybe call it "Formatting file"?

@daviwil daviwil merged commit 0197b50 into develop Jan 25, 2017
@daviwil daviwil deleted the kapilmb/formatting-status branch January 25, 2017 17:49
@kapilmb
Copy link
Author

kapilmb commented Jan 25, 2017

I thought even "formatting..." looks a bit big. Here is how it looks now:

formattingstatus

@daviwil
Copy link
Contributor

daviwil commented Jan 25, 2017

It looks like the normal status bar text, I think it's fine to be a bit longer. I can make the change.

@kapilmb
Copy link
Author

kapilmb commented Jan 25, 2017

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.

@daviwil
Copy link
Contributor

daviwil commented Jan 25, 2017

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.

@kapilmb
Copy link
Author

kapilmb commented Jan 25, 2017

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!

@daviwil
Copy link
Contributor

daviwil commented Jan 25, 2017

Awesome, thanks for working on that!

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

Successfully merging this pull request may close these issues.

3 participants