Skip to content

Commit

Permalink
lsp: Align to low-level API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Dec 1, 2024
1 parent f0bc363 commit 56c9ea6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ def _set_state(self, new_state: ClientState):
async def stop(self):
"""Stop the client."""

if self.state in {ClientState.Running, ClientState.Building}:
self.protocol.notify("exit", None)
self.protocol.notify("exit", None)

# Give the agent a little time to close.
await asyncio.sleep(0.5)
Expand Down
7 changes: 3 additions & 4 deletions lib/esbonio/tests/e2e/test_sphinx_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import pytest_asyncio
from lsprotocol import types as lsp
from pygls import IS_WIN
from pygls.server import StdOutTransportAdapter

from esbonio.server import EsbonioLanguageServer
from esbonio.server import Uri
Expand Down Expand Up @@ -50,7 +49,7 @@ async def server_manager(demo_workspace: Uri, docs_workspace):
loop = asyncio.get_running_loop()

esbonio = create_language_server(EsbonioLanguageServer, [], loop=loop)
esbonio.protocol.transport = StdOutTransportAdapter(io.BytesIO(), sys.stderr.buffer)
esbonio.protocol.set_writer(io.BytesIO())

project_manager = ProjectManager(esbonio)
esbonio.add_feature(project_manager)
Expand All @@ -62,7 +61,7 @@ async def server_manager(demo_workspace: Uri, docs_workspace):

async def initialize(init_options):
# Initialize the server.
esbonio.protocol._procedure_handler(
esbonio.protocol.handle_message(
lsp.InitializeRequest(
id=1,
params=lsp.InitializeParams(
Expand All @@ -76,7 +75,7 @@ async def initialize(init_options):
)
)

esbonio.protocol._procedure_handler(
esbonio.protocol.handle_message(
lsp.InitializedNotification(params=lsp.InitializedParams())
)

Expand Down

0 comments on commit 56c9ea6

Please sign in to comment.