Skip to content
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

Automatically hide the diagnostics panel on save #2037

Merged
merged 3 commits into from
Sep 8, 2022

Conversation

tdaniel22
Copy link
Contributor

This PR extends the "show diagnostics panel on save" feature, and hides the panel if the diagnostics level is higher than the show_diagnostics_panel_on_save setting.

I took the easy route and and made this the default behaviour, but maybe a better way to do this would be to implement a new option, e.g. close_diagnostics_panel_on_save.

I'm no Python or ST3 plugin expert, so I'm not 100% sure this is the correct way of doing this.

Fixes #1904

@rchl
Copy link
Member

rchl commented Aug 30, 2022

I don't think we need another option for this (well, unless someone inevitably complains at least) but I would still tie this functionality to the show_diagnostics_panel_on_save option. I wouldn't close automatically unless it's enabled.

@tdaniel22 tdaniel22 force-pushed the close-diagnostics-on-save branch from 417f457 to a0f8d63 Compare August 30, 2022 20:13
@tdaniel22
Copy link
Contributor Author

tdaniel22 commented Aug 30, 2022

Right, forgot that detail. Now if the show_diagnostics_panel_on_save option is set to 0 (disabled), the panel stays visible.

plugin/session_buffer.py Outdated Show resolved Hide resolved
@tdaniel22 tdaniel22 force-pushed the close-diagnostics-on-save branch from a0f8d63 to 6563d3e Compare August 30, 2022 21:43
@tdaniel22
Copy link
Contributor Author

I'm getting pretty far out of my comfort zone here, but I managed to get something working. I'm absolutely not sure this fixes the multiple-servers scenario you mentioned though.

Not sure about the change_count checking either, I copied what the diagnostics_async function was doing but that may be unnecessary.

plugin/documents.py Outdated Show resolved Hide resolved
@tdaniel22 tdaniel22 force-pushed the close-diagnostics-on-save branch from 6563d3e to e5a36d0 Compare August 30, 2022 22:16
@tdaniel22 tdaniel22 force-pushed the close-diagnostics-on-save branch from e5a36d0 to a96e326 Compare August 30, 2022 22:25
plugin/documents.py Outdated Show resolved Hide resolved
plugin/documents.py Outdated Show resolved Hide resolved
rchl added 2 commits September 7, 2022 20:42
* main:
  Add support for triggerKind in code action requests (sublimelsp#2042)
  Custom context menu in log panel and "Clear log panel" item (sublimelsp#2045)
  Add icons and isPreferred support for code actions (sublimelsp#2040)
  Cut 1.18.0
Copy link
Member

@rchl rchl left a comment

Choose a reason for hiding this comment

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

Anyone else wants to review?

@predragnikolic
Copy link
Member

👀 will give it a look

@rchl rchl merged commit 53cea14 into sublimelsp:main Sep 8, 2022
rchl added a commit that referenced this pull request Sep 11, 2022
* main:
  Add group argument for LspGotoCommand (#2031)
  Add context menu entry in log panel for toggling lines limit (#2047)
  Automatically hide the diagnostics panel on save (#2037)
  Add support for triggerKind in code action requests (#2042)
  Custom context menu in log panel and "Clear log panel" item (#2045)
  Add icons and isPreferred support for code actions (#2040)
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.

Close the diagnostics panel automatically on save
3 participants