Skip to content

Conversation

sandy081
Copy link
Member

  • Expose visibility change event in status bar
  • Listen to the event to show or hide status entry by default
  • Register a command to show current problem status entry

This PR fixes #20183

- Listen to the event to show or hide status entry by default
- Register a command to show current problem status entry
@sandy081 sandy081 added this to the November 2019 milestone Nov 12, 2019
@sandy081 sandy081 requested a review from bpasero November 12, 2019 17:06
@sandy081 sandy081 self-assigned this Nov 12, 2019
@sandy081
Copy link
Member Author

@bpasero Added an event onDidChangeEntryVisibility to IStatusbarService to listen to visibility changes. This is needed for my status bar entry to hide it by default.

This event will also be helpful for other status bar entries to release any event listeners

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I typically prefer to not repeat types, e.g. this:

private readonly _onDidChangeEntryVisibility: Emitter<{ id: string, visible: boolean }> = this._register(new Emitter<{ id: string, visible: boolean }>());

can be written shorter as:

private readonly _onDidChangeEntryVisibility = this._register(new Emitter<{ id: string, visible: boolean }>());

given automatic type inference.

@sandy081
Copy link
Member Author

@bpasero I no longer need this event as I decided to use setting to enable or disable the feature - Show current error in the status bar. I still think this event is helpful for others to release the listeners. So, I would push this change, what do you think?

@bpasero
Copy link
Member

bpasero commented Nov 13, 2019

I still think this event is helpful for others to release the listeners.

Who would use this event can you show an example?

@sandy081
Copy link
Member Author

Eg: Editor Status bar contributions. They listen on editor and get updated. When they are hidden these listeners can be disposed and re-registered after getting shown again.

@bpasero
Copy link
Member

bpasero commented Nov 13, 2019

@sandy081 oh yeah makes sense, feel free to add it

@sandy081 sandy081 merged commit 69fb28c into master Nov 13, 2019
@sandy081 sandy081 deleted the sandy081/showCurrentProblem branch November 13, 2019 07:32
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show current error in status bar
2 participants