chromium/v8/src/torque/ls/message.h

// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_TORQUE_LS_MESSAGE_H_
#define V8_TORQUE_LS_MESSAGE_H_

#include "src/base/logging.h"
#include "src/torque/ls/json.h"
#include "src/torque/ls/message-macros.h"
#include "src/torque/source-positions.h"

namespace v8 {
namespace internal {
namespace torque {
namespace ls {

// Base class for Messages and Objects that are backed by either a
// JsonValue or a reference to a JsonObject.
// Helper methods are used by macros to implement typed accessors.
class BaseJsonAccessor {};

// Base class for Requests, Responses and Notifications.
// In contrast to "BaseObject", a Message owns the backing JsonValue of the
// whole object tree; i.e. value_ serves as root.
class Message : public BaseJsonAccessor {};

// Base class for complex type that might be part of a Message.
// Instead of creating theses directly, use the accessors on the
// root Message or a parent object.
class NestedJsonAccessor : public BaseJsonAccessor {};

class ResponseError : public NestedJsonAccessor {};

class InitializeParams : public NestedJsonAccessor {};

class FileListParams : public NestedJsonAccessor {};

class FileSystemWatcher : public NestedJsonAccessor {};

class DidChangeWatchedFilesRegistrationOptions : public NestedJsonAccessor {};

class FileEvent : public NestedJsonAccessor {};

class DidChangeWatchedFilesParams : public NestedJsonAccessor {};

class SaveOptions : public NestedJsonAccessor {};

class TextDocumentSyncOptions : public NestedJsonAccessor {};

class ServerCapabilities : public NestedJsonAccessor {};

class InitializeResult : public NestedJsonAccessor {};

class Registration : public NestedJsonAccessor {};

class RegistrationParams : public NestedJsonAccessor {};

class JsonPosition : public NestedJsonAccessor {};

class Range : public NestedJsonAccessor {};

class Location : public NestedJsonAccessor {};

class TextDocumentIdentifier : public NestedJsonAccessor {};

class TextDocumentPositionParams : public NestedJsonAccessor {};

class Diagnostic : public NestedJsonAccessor {};

class PublishDiagnosticsParams : public NestedJsonAccessor {};

enum SymbolKind {};

class DocumentSymbolParams : public NestedJsonAccessor {};

class SymbolInformation : public NestedJsonAccessor {};

template <class T>
class Request : public Message {};
InitializeRequest;
RegistrationRequest;
TorqueFileListNotification;
GotoDefinitionRequest;
DidChangeWatchedFilesNotification;
PublishDiagnosticsNotification;
DocumentSymbolRequest;

template <class T>
class Response : public Message {};
InitializeResponse;
GotoDefinitionResponse;

// Same as "Response" but the result is T[] instead of T.
template <class T>
class ResponseArrayResult : public Message {};
DocumentSymbolResponse;

}  // namespace ls
}  // namespace torque
}  // namespace internal
}  // namespace v8

#endif  // V8_TORQUE_LS_MESSAGE_H_