diff --git a/docs/source/howto/migrate-to-v2.rst b/docs/source/howto/migrate-to-v2.rst index 32e8acdb..3fde3e02 100644 --- a/docs/source/howto/migrate-to-v2.rst +++ b/docs/source/howto/migrate-to-v2.rst @@ -349,3 +349,18 @@ As part of the update to ``lsprotocol v2024``, the following types have been ren ``WorkspaceWorkspaceFoldersRequest`` ``WorkspaceFoldersRequest`` ``WorkspaceWorkspaceFoldersResponse`` ``WorkspaceFoldersResponse`` =================================================================================== ============== + +Low Level Changes +----------------- + +The following changes are unlikely to affect you directly, but have been included for completeness. + +``LanguageServer.lsp`` is now ``LanguageServer.protocol`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you need to access the underlying protocol object this is now via the ``protocol`` attribute. + +``pygls.server.Server`` is now ``pygls.server.JsonRPCServer`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +pygls' base server class has been renamed diff --git a/pygls/lsp/_base_server.py b/pygls/lsp/_base_server.py index fc8f4f24..af47abd6 100644 --- a/pygls/lsp/_base_server.py +++ b/pygls/lsp/_base_server.py @@ -5,7 +5,7 @@ from lsprotocol import types from pygls.protocol import LanguageServerProtocol from pygls.protocol import default_converter -from pygls.server import Server +from pygls.server import JsonRPCServer import typing from typing import Any from typing import Callable @@ -14,7 +14,7 @@ from typing import Type -class BaseLanguageServer(Server): +class BaseLanguageServer(JsonRPCServer): protocol: LanguageServerProtocol diff --git a/pygls/server.py b/pygls/server.py index 29aee81f..d82b8874 100644 --- a/pygls/server.py +++ b/pygls/server.py @@ -147,7 +147,7 @@ def write(self, data: Any) -> None: asyncio.ensure_future(self._ws.send(data)) -class Server: +class JsonRPCServer: """Base server class Parameters