Skip to content

Show current problem in the status bar - #84609

Merged
Sandeep Somavarapu (sandy081) merged 5 commits into
masterfrom
sandy081/showCurrentProblem
Nov 13, 2019
Merged

Sandeep Somavarapu (sandy081) merged 5 commits into
masterfrom
sandy081/showCurrentProblem

Conversation

@sandy081

Copy link
Copy Markdown
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

Copy link
Copy Markdown
Member Author

Benjamin Pasero (@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

@bpasero Benjamin Pasero (bpasero) left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member Author

Benjamin Pasero (@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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

Sandeep Somavarapu (@sandy081) oh yeah makes sense, feel free to add it

@sandy081
Sandeep Somavarapu (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