Example #1
0
        public async Task <object?> ExecuteWorkspaceCommandAsync(LSP.ExecuteCommandParams request, CancellationToken cancellationToken)
        {
            Contract.ThrowIfNull(_clientCapabilities, $"{nameof(InitializeAsync)} has not been called.");
            var requestMethod = AbstractExecuteWorkspaceCommandHandler.GetRequestNameForCommandName(request.Command);

            var result = await _requestDispatcher.ExecuteRequestAsync <LSP.ExecuteCommandParams, object>(
                requestMethod,
                request,
                _clientCapabilities,
                _queue,
                cancellationToken).ConfigureAwait(false);

            return(result);
        }
Example #2
0
        public Task <LSP.Location[]> GetTextDocumentDefinitionAsync(TextDocumentPositionParams textDocumentPositionParams, CancellationToken cancellationToken)
        {
            Contract.ThrowIfNull(_clientCapabilities, $"{nameof(InitializeAsync)} has not been called.");

            return(RequestDispatcher.ExecuteRequestAsync <TextDocumentPositionParams, LSP.Location[]>(Queue, Methods.TextDocumentDefinitionName,
                                                                                                      textDocumentPositionParams, _clientCapabilities, ClientName, cancellationToken));
        }