Skip to content

Commit

Permalink
Update method for printing messages to the status bar (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann authored Dec 6, 2024
1 parent 9c7e415 commit da60d35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions core/handle_execute_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections import OrderedDict
from . status import status_key
from .. commands.utils import open_location
from LSP.plugin import Session
from LSP.plugin.core.types import Any
Expand All @@ -23,7 +22,7 @@ def handle_execute_client(session: Session, params: Any) -> None:
run_doctor(session, args)
else:
msg = "Unknown command {}".format(command_name)
session.set_window_status_async(status_key, msg)
session.window.status_message(msg)


def goto_location(session: Session, args: Any) -> None:
Expand Down
6 changes: 2 additions & 4 deletions core/status.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from LSP.plugin import Session
from LSP.plugin.core.types import Any

status_key = "metals-status"


def handle_status(session: Session, params: Any) -> None:
"""Handle the metals/status notification."""
Expand All @@ -11,6 +9,6 @@ def handle_status(session: Session, params: Any) -> None:
return
hide = params.get("hide") if isinstance(params.get("hide"), bool) else False
if not hide:
session.set_window_status_async(status_key, params.get('text', ''))
session.set_config_status_async(params.get('text', ''))
else:
session.erase_window_status_async(status_key)
session.set_config_status_async('')

0 comments on commit da60d35

Please sign in to comment.