Skip to content

Commit

Permalink
Add log message
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylmay authored and ccordoba12 committed Jul 24, 2024
1 parent 9b79576 commit eba4c0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pylsp/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Workspace:
M_INITIALIZE_PROGRESS = "window/workDoneProgress/create"
M_APPLY_EDIT = "workspace/applyEdit"
M_SHOW_MESSAGE = "window/showMessage"
M_LOG_MESSAGE = "window/logMessage"

def __init__(self, root_uri, endpoint, config=None):
self._config = config
Expand Down Expand Up @@ -323,6 +324,11 @@ def _progress_end(self, token: str, message: Optional[str] = None) -> None:
"value": value,
},
)

def log_message(self, message, msg_type=lsp.MessageType.Info):
self._endpoint.notify(
self.M_LOG_MESSAGE, params={"type": msg_type, "message": message}
)

def show_message(self, message, msg_type=lsp.MessageType.Info):
self._endpoint.notify(
Expand Down

0 comments on commit eba4c0e

Please sign in to comment.