-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove ensure_*_panel and ensure_panel and create_panel functions with a class Panel that abstracts all the interaction with the panels
- Loading branch information
1 parent
f6e17d3
commit 7901a7c
Showing
8 changed files
with
136 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
from .core.diagnostics import ensure_diagnostics_panel | ||
from .core.panels import ensure_server_panel | ||
from .core.panels import PanelName | ||
from sublime import Window | ||
from sublime_plugin import WindowCommand | ||
from .core.panels import diagnostics_panel, language_servers_panel | ||
import sublime_plugin | ||
|
||
|
||
def toggle_output_panel(window: Window, panel_type: str) -> None: | ||
panel_name = "output.{}".format(panel_type) | ||
command = "{}_panel".format("hide" if window.active_panel() == panel_name else "show") | ||
window.run_command(command, {"panel": panel_name}) | ||
|
||
|
||
class LspToggleServerPanelCommand(WindowCommand): | ||
class LspToggleServerPanelCommand(sublime_plugin.WindowCommand): | ||
def run(self) -> None: | ||
ensure_server_panel(self.window) | ||
toggle_output_panel(self.window, PanelName.LanguageServers) | ||
language_servers_panel.toggle(self.window) | ||
|
||
|
||
class LspShowDiagnosticsPanelCommand(WindowCommand): | ||
class LspShowDiagnosticsPanelCommand(sublime_plugin.WindowCommand): | ||
def run(self) -> None: | ||
ensure_diagnostics_panel(self.window) | ||
toggle_output_panel(self.window, PanelName.Diagnostics) | ||
diagnostics_panel.toggle(self.window) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.