brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 995fe38 Raw
56 lines · cpp
1//===-- CancelRequestHandler.cpp ------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "Handler/RequestHandler.h"10#include "Protocol/ProtocolRequests.h"11#include "llvm/Support/Error.h"12 13using namespace llvm;14using namespace lldb_dap::protocol;15 16namespace lldb_dap {17 18/// The `cancel` request is used by the client in two situations:19///20/// - to indicate that it is no longer interested in the result produced by a21/// specific request issued earlier22/// - to cancel a progress sequence.23///24/// Clients should only call this request if the corresponding capability25/// `supportsCancelRequest` is true.26///27/// This request has a hint characteristic: a debug adapter can only be28/// expected to make a 'best effort' in honoring this request but there are no29/// guarantees.30///31/// The `cancel` request may return an error if it could not cancel32/// an operation but a client should refrain from presenting this error to end33/// users.34///35/// The request that got cancelled still needs to send a response back.36/// This can either be a normal result (`success` attribute true) or an error37/// response (`success` attribute false and the `message` set to `cancelled`).38///39/// Returning partial results from a cancelled request is possible but please40/// note that a client has no generic way for detecting that a response is41/// partial or not.42///43/// The progress that got cancelled still needs to send a `progressEnd` event44/// back.45///46/// A client cannot assume that progress just got cancelled after sending47/// the `cancel` request.48Error CancelRequestHandler::Run(const CancelArguments &arguments) const {49  // Cancel support is built into the DAP::Loop handler for detecting50  // cancellations of pending or inflight requests.51  dap.ClearCancelRequest(arguments);52  return Error::success();53}54 55} // namespace lldb_dap56