def _initialize_server(server): server.lsp.lsp_initialize( InitializeParams( process_id=1234, root_uri=pathlib.Path(__file__).parent.as_uri(), capabilities=ClientCapabilities(), ))
def initialize(self): response = self.client.lsp.send_request( INITIALIZE, InitializeParams(process_id=12345, root_uri="file://", capabilities=ClientCapabilities())).result( timeout=CALL_TIMEOUT) assert 'capabilities' in response
def test_initialize_should_return_server_capabilities(client_server): _, server = client_server params = InitializeParams( process_id=1234, root_uri=Path(__file__).parent.as_uri(), capabilities=ClientCapabilities(), ) server_capabilities = server.lsp.bf_initialize(params) assert isinstance(server_capabilities, InitializeResult)
def initialize(self): from pygls.lsp.methods import INITIALIZE from pygls.lsp.types import ClientCapabilities, InitializeParams response = self.client.lsp.send_request( INITIALIZE, InitializeParams(process_id=12345, root_uri="file://", capabilities=ClientCapabilities())).result( timeout=CALL_TIMEOUT) assert "capabilities" in response
def _init(client: LanguageServer, root: Path) -> None: retry = 3 while retry > 0: try: client.lsp.send_request( INITIALIZE, InitializeParams( process_id=1234, root_uri=root.as_uri(), capabilities=ClientCapabilities(), ), ).result(timeout=CALL_TIMEOUT) except futures.TimeoutError: retry -= 1 else: break