mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 12:17:02 +00:00
Merge branch 'main' into mypy_on_solidlsp
Conflicts: src/solidlsp/language_servers/elixir_tools/elixir_tools.py src/solidlsp/language_servers/gopls.py src/solidlsp/language_servers/terraform_ls.py src/solidlsp/ls.py src/solidlsp/ls_handler.py
This commit is contained in:
commit
11cb8f2811
155 files changed
+11240
-2829
No files matched your search
@@ -2,6 +2,8 @@
|
||||
This module contains the exceptions raised by the framework.
|
||||
"""
|
||||
|
||||
from solidlsp.ls_config import Language
|
||||
|
||||
|
||||
class SolidLSPException(Exception):
|
||||
def __init__(self, message: str, cause: Exception | None = None) -> None:
|
||||
@@ -26,6 +28,16 @@ class SolidLSPException(Exception):
|
||||
|
||||
return isinstance(self.cause, LanguageServerTerminatedException)
|
||||
|
||||
def get_affected_language(self) -> Language | None:
|
||||
"""
|
||||
:return: the affected language for the case where the exception is caused by the language server having terminated
|
||||
"""
|
||||
from .ls_handler import LanguageServerTerminatedException
|
||||
|
||||
if isinstance(self.cause, LanguageServerTerminatedException):
|
||||
return self.cause.language
|
||||
return None
|
||||
|
||||
def __str__(self) -> str:
|
||||
"""
|
||||
Returns a string representation of the exception.
|
||||
|
||||
Reference in new issue
Block a user