예제 #1
0
def _initialize_server(server):
    server.lsp.lsp_initialize(
        InitializeParams(
            process_id=1234,
            root_uri=pathlib.Path(__file__).parent.as_uri(),
            capabilities=ClientCapabilities(),
        ))
예제 #2
0
파일: conftest.py 프로젝트: tomaszgil/pygls
    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
예제 #3
0
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)
예제 #4
0
    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
예제 #5
0
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