mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-20 00:15:41 +00:00
Add LanguageServerManager, adding multi-language support in a single project
This commit is contained in:
1 parent
340338f593
commit
e0ab4db189
16 files changed
+277
-127
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):
|
||||
@@ -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