clang-tools  10.0.0svn
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
Protocol.h File Reference
#include "URI.h"
#include "index/SymbolID.h"
#include "clang/Index/IndexSymbol.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/raw_ostream.h"
#include <bitset>
#include <string>
#include <vector>
Include dependency graph for Protocol.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  clang::clangd::LSPError
 
struct  clang::clangd::URIForFile
 
struct  clang::clangd::TextDocumentIdentifier
 
struct  clang::clangd::Position
 
struct  clang::clangd::Range
 
struct  clang::clangd::Location
 
struct  clang::clangd::TextEdit
 
struct  clang::clangd::TextDocumentItem
 
struct  clang::clangd::NoParams
 
struct  clang::clangd::ClientCapabilities
 
struct  clang::clangd::ClangdCompileCommand
 Clangd extension that's used in the 'compilationDatabaseChanges' in workspace/didChangeConfiguration to record updates to the in-memory compilation database. More...
 
struct  clang::clangd::ConfigurationSettings
 Clangd extension: parameters configurable at any time, via the workspace/didChangeConfiguration notification. More...
 
struct  clang::clangd::InitializationOptions
 Clangd extension: parameters configurable at initialize time. More...
 
struct  clang::clangd::InitializeParams
 
struct  clang::clangd::ShowMessageParams
 The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface. More...
 
struct  clang::clangd::DidOpenTextDocumentParams
 
struct  clang::clangd::DidCloseTextDocumentParams
 
struct  clang::clangd::TextDocumentContentChangeEvent
 
struct  clang::clangd::DidChangeTextDocumentParams
 
struct  clang::clangd::FileEvent
 
struct  clang::clangd::DidChangeWatchedFilesParams
 
struct  clang::clangd::DidChangeConfigurationParams
 
struct  clang::clangd::DocumentRangeFormattingParams
 
struct  clang::clangd::DocumentOnTypeFormattingParams
 
struct  clang::clangd::DocumentFormattingParams
 
struct  clang::clangd::DocumentSymbolParams
 
struct  clang::clangd::DiagnosticRelatedInformation
 Represents a related message and source code location for a diagnostic. More...
 
struct  clang::clangd::Diagnostic
 
struct  clang::clangd::LSPDiagnosticCompare
 A LSP-specific comparator used to find diagnostic in a container like std:map. More...
 
struct  clang::clangd::CodeActionContext
 
struct  clang::clangd::CodeActionParams
 
struct  clang::clangd::WorkspaceEdit
 
struct  clang::clangd::TweakArgs
 Arguments for the 'applyTweak' command. More...
 
struct  clang::clangd::ExecuteCommandParams
 Exact commands are not specified in the protocol so we define the ones supported by Clangd here. More...
 
struct  clang::clangd::Command
 
struct  clang::clangd::CodeAction
 A code action represents a change that can be performed in code, e.g. More...
 
struct  clang::clangd::DocumentSymbol
 Represents programming constructs like variables, classes, interfaces etc. More...
 
struct  clang::clangd::SymbolInformation
 Represents information about programming constructs like variables, classes, interfaces etc. More...
 
struct  clang::clangd::SymbolDetails
 Represents information about identifier. More...
 
struct  clang::clangd::WorkspaceSymbolParams
 The parameters of a Workspace Symbol Request. More...
 
struct  clang::clangd::ApplyWorkspaceEditParams
 
struct  clang::clangd::ApplyWorkspaceEditResponse
 
struct  clang::clangd::TextDocumentPositionParams
 
struct  clang::clangd::CompletionContext
 
struct  clang::clangd::CompletionParams
 
struct  clang::clangd::MarkupContent
 
struct  clang::clangd::Hover
 
struct  clang::clangd::CompletionItem
 
struct  clang::clangd::CompletionList
 Represents a collection of completion items to be presented in the editor. More...
 
struct  clang::clangd::ParameterInformation
 A single parameter of a particular signature. More...
 
struct  clang::clangd::SignatureInformation
 Represents the signature of something callable. More...
 
struct  clang::clangd::SignatureHelp
 Represents the signature of a callable. More...
 
struct  clang::clangd::RenameParams
 
struct  clang::clangd::DocumentHighlight
 A document highlight is a range inside a text document which deserves special attention. More...
 
struct  clang::clangd::TypeHierarchyParams
 The type hierarchy params is an extension of the TextDocumentPositionsParams with optional properties which can be used to eagerly resolve the item when requesting from the server. More...
 
struct  clang::clangd::TypeHierarchyItem
 
struct  clang::clangd::ResolveTypeHierarchyItemParams
 Parameters for the typeHierarchy/resolve request. More...
 
struct  clang::clangd::ReferenceParams
 
struct  clang::clangd::FileStatus
 Clangd extension: indicates the current state of the file in clangd, sent from server via the textDocument/clangd.fileStatus notification. More...
 
struct  clang::clangd::SemanticHighlightingInformation
 Represents a semantic highlighting information that has to be applied on a specific line of the text document. More...
 
struct  clang::clangd::SemanticHighlightingParams
 Parameters for the semantic highlighting (server-side) push notification. More...
 
struct  llvm::format_provider< clang::clangd::Position >
 

Namespaces

 clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
 clang::clangd
 
 llvm
 Some operations such as code completion produce a set of candidates.
 

Typedefs

using clang::clangd::ShutdownParams = NoParams
 
using clang::clangd::ExitParams = NoParams
 
using clang::clangd::CompletionItemKindBitset = std::bitset< CompletionItemKindMax+1 >
 
using clang::clangd::SymbolKindBitset = std::bitset< SymbolKindMax+1 >
 

Enumerations

enum  clang::clangd::ErrorCode {
  clang::clangd::ErrorCode::ParseError = -32700, clang::clangd::ErrorCode::InvalidRequest = -32600, clang::clangd::ErrorCode::MethodNotFound = -32601, clang::clangd::ErrorCode::InvalidParams = -32602,
  clang::clangd::ErrorCode::InternalError = -32603, clang::clangd::ErrorCode::ServerNotInitialized = -32002, clang::clangd::ErrorCode::UnknownErrorCode = -32001, clang::clangd::ErrorCode::RequestCancelled = -32800
}
 
enum  clang::clangd::TraceLevel { clang::clangd::TraceLevel::Off = 0, clang::clangd::TraceLevel::Messages = 1, clang::clangd::TraceLevel::Verbose = 2 }
 
enum  clang::clangd::TextDocumentSyncKind { clang::clangd::TextDocumentSyncKind::None = 0, clang::clangd::TextDocumentSyncKind::Full = 1, clang::clangd::TextDocumentSyncKind::Incremental = 2 }
 Defines how the host (editor) should sync document changes to the language server. More...
 
enum  clang::clangd::CompletionItemKind {
  clang::clangd::CompletionItemKind::Missing = 0, clang::clangd::CompletionItemKind::Text = 1, clang::clangd::CompletionItemKind::Method = 2, clang::clangd::CompletionItemKind::Function = 3,
  clang::clangd::CompletionItemKind::Constructor = 4, clang::clangd::CompletionItemKind::Field = 5, clang::clangd::CompletionItemKind::Variable = 6, clang::clangd::CompletionItemKind::Class = 7,
  clang::clangd::CompletionItemKind::Interface = 8, clang::clangd::CompletionItemKind::Module = 9, clang::clangd::CompletionItemKind::Property = 10, clang::clangd::CompletionItemKind::Unit = 11,
  clang::clangd::CompletionItemKind::Value = 12, clang::clangd::CompletionItemKind::Enum = 13, clang::clangd::CompletionItemKind::Keyword = 14, clang::clangd::CompletionItemKind::Snippet = 15,
  clang::clangd::CompletionItemKind::Color = 16, clang::clangd::CompletionItemKind::File = 17, clang::clangd::CompletionItemKind::Reference = 18, clang::clangd::CompletionItemKind::Folder = 19,
  clang::clangd::CompletionItemKind::EnumMember = 20, clang::clangd::CompletionItemKind::Constant = 21, clang::clangd::CompletionItemKind::Struct = 22, clang::clangd::CompletionItemKind::Event = 23,
  clang::clangd::CompletionItemKind::Operator = 24, clang::clangd::CompletionItemKind::TypeParameter = 25
}
 The kind of a completion entry. More...
 
enum  clang::clangd::SymbolKind {
  clang::clangd::SymbolKind::File = 1, clang::clangd::SymbolKind::Module = 2, clang::clangd::SymbolKind::Namespace = 3, clang::clangd::SymbolKind::Package = 4,
  clang::clangd::SymbolKind::Class = 5, clang::clangd::SymbolKind::Method = 6, clang::clangd::SymbolKind::Property = 7, clang::clangd::SymbolKind::Field = 8,
  clang::clangd::SymbolKind::Constructor = 9, clang::clangd::SymbolKind::Enum = 10, clang::clangd::SymbolKind::Interface = 11, clang::clangd::SymbolKind::Function = 12,
  clang::clangd::SymbolKind::Variable = 13, clang::clangd::SymbolKind::Constant = 14, clang::clangd::SymbolKind::String = 15, clang::clangd::SymbolKind::Number = 16,
  clang::clangd::SymbolKind::Boolean = 17, clang::clangd::SymbolKind::Array = 18, clang::clangd::SymbolKind::Object = 19, clang::clangd::SymbolKind::Key = 20,
  clang::clangd::SymbolKind::Null = 21, clang::clangd::SymbolKind::EnumMember = 22, clang::clangd::SymbolKind::Struct = 23, clang::clangd::SymbolKind::Event = 24,
  clang::clangd::SymbolKind::Operator = 25, clang::clangd::SymbolKind::TypeParameter = 26
}
 A symbol kind. More...
 
enum  clang::clangd::OffsetEncoding { clang::clangd::OffsetEncoding::UnsupportedEncoding, clang::clangd::OffsetEncoding::UTF16, clang::clangd::OffsetEncoding::UTF8, clang::clangd::OffsetEncoding::UTF32 }
 
enum  clang::clangd::MarkupKind { clang::clangd::MarkupKind::PlainText, clang::clangd::MarkupKind::Markdown }
 
enum  clang::clangd::MessageType { clang::clangd::MessageType::Error = 1, clang::clangd::MessageType::Warning = 2, clang::clangd::MessageType::Info = 3, clang::clangd::MessageType::Log = 4 }
 
enum  clang::clangd::FileChangeType { clang::clangd::FileChangeType::Created = 1, clang::clangd::FileChangeType::Changed = 2, clang::clangd::FileChangeType::Deleted = 3 }
 
enum  clang::clangd::CompletionTriggerKind { clang::clangd::CompletionTriggerKind::Invoked = 1, clang::clangd::CompletionTriggerKind::TriggerCharacter = 2, clang::clangd::CompletionTriggerKind::TriggerTriggerForIncompleteCompletions = 3 }
 
enum  clang::clangd::InsertTextFormat { clang::clangd::InsertTextFormat::Missing = 0, clang::clangd::InsertTextFormat::PlainText = 1, clang::clangd::InsertTextFormat::Snippet = 2 }
 Defines whether the insert text in a completion item should be interpreted as plain text or a snippet. More...
 
enum  clang::clangd::DocumentHighlightKind { clang::clangd::DocumentHighlightKind::Text = 1, clang::clangd::DocumentHighlightKind::Read = 2, clang::clangd::DocumentHighlightKind::Write = 3 }
 
enum  clang::clangd::TypeHierarchyDirection { clang::clangd::TypeHierarchyDirection::Children = 0, clang::clangd::TypeHierarchyDirection::Parents = 1, clang::clangd::TypeHierarchyDirection::Both = 2 }
 

Functions

llvm::json::Value clang::clangd::toJSON (const URIForFile &U)
 Serialize/deserialize URIForFile to/from a string URI. More...
 
bool clang::clangd::fromJSON (const llvm::json::Value &E, URIForFile &R)
 
llvm::json::Value clang::clangd::toJSON (const TextDocumentIdentifier &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, TextDocumentIdentifier &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, Position &R)
 
llvm::json::Value clang::clangd::toJSON (const Position &P)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, const Position &P)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, Range &R)
 
llvm::json::Value clang::clangd::toJSON (const Range &P)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, const Range &R)
 
llvm::json::Value clang::clangd::toJSON (const Location &P)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, const Location &L)
 
bool clang::clangd::operator== (const TextEdit &L, const TextEdit &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, TextEdit &R)
 
llvm::json::Value clang::clangd::toJSON (const TextEdit &P)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, const TextEdit &TE)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, TextDocumentItem &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &E, TraceLevel &Out)
 
bool clang::clangd::fromJSON (const llvm::json::Value &, NoParams &)
 
bool clang::clangd::fromJSON (const llvm::json::Value &E, CompletionItemKind &Out)
 
bool clang::clangd::fromJSON (const llvm::json::Value &E, CompletionItemKindBitset &Out)
 
CompletionItemKind clang::clangd::adjustKindToCapability (CompletionItemKind Kind, CompletionItemKindBitset &SupportedCompletionItemKinds)
 
bool clang::clangd::fromJSON (const llvm::json::Value &E, SymbolKind &Out)
 
bool clang::clangd::fromJSON (const llvm::json::Value &E, SymbolKindBitset &Out)
 
SymbolKind clang::clangd::adjustKindToCapability (SymbolKind Kind, SymbolKindBitset &SupportedSymbolKinds)
 
SymbolKind clang::clangd::indexSymbolKindToSymbolKind (index::SymbolKind Kind)
 
llvm::json::Value clang::clangd::toJSON (const OffsetEncoding &OE)
 
bool clang::clangd::fromJSON (const llvm::json::Value &V, OffsetEncoding &OE)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, OffsetEncoding Enc)
 
bool clang::clangd::fromJSON (const llvm::json::Value &V, MarkupKind &K)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, MarkupKind K)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, ClientCapabilities &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, ClangdCompileCommand &CDbUpdate)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, ConfigurationSettings &S)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, InitializationOptions &Opts)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, InitializeParams &R)
 
llvm::json::Value clang::clangd::toJSON (const MessageType &R)
 
llvm::json::Value clang::clangd::toJSON (const ShowMessageParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DidOpenTextDocumentParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DidCloseTextDocumentParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, TextDocumentContentChangeEvent &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DidChangeTextDocumentParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &E, FileChangeType &Out)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, FileEvent &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DidChangeWatchedFilesParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DidChangeConfigurationParams &CCP)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DocumentRangeFormattingParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DocumentOnTypeFormattingParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DocumentFormattingParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, DocumentSymbolParams &R)
 
llvm::json::Value clang::clangd::toJSON (const DiagnosticRelatedInformation &DRI)
 
llvm::json::Value clang::clangd::toJSON (const Diagnostic &D)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, Diagnostic &R)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, const Diagnostic &D)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, CodeActionContext &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, CodeActionParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, WorkspaceEdit &R)
 
llvm::json::Value clang::clangd::toJSON (const WorkspaceEdit &WE)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, TweakArgs &A)
 
llvm::json::Value clang::clangd::toJSON (const TweakArgs &A)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, ExecuteCommandParams &R)
 
llvm::json::Value clang::clangd::toJSON (const Command &C)
 
llvm::json::Value clang::clangd::toJSON (const CodeAction &CA)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &O, const DocumentSymbol &S)
 
llvm::json::Value clang::clangd::toJSON (const DocumentSymbol &S)
 
llvm::json::Value clang::clangd::toJSON (const SymbolInformation &P)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &O, const SymbolInformation &SI)
 
llvm::json::Value clang::clangd::toJSON (const SymbolDetails &P)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &O, const SymbolDetails &S)
 
bool clang::clangd::operator== (const SymbolDetails &LHS, const SymbolDetails &RHS)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, WorkspaceSymbolParams &R)
 
llvm::json::Value clang::clangd::toJSON (const ApplyWorkspaceEditParams &Params)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Response, ApplyWorkspaceEditResponse &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, TextDocumentPositionParams &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, CompletionContext &R)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, CompletionParams &R)
 
llvm::json::Value clang::clangd::toJSON (const MarkupContent &MC)
 
llvm::json::Value clang::clangd::toJSON (const Hover &H)
 
llvm::json::Value clang::clangd::toJSON (const CompletionItem &CI)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &O, const CompletionItem &I)
 
bool clang::clangd::operator< (const CompletionItem &L, const CompletionItem &R)
 
llvm::json::Value clang::clangd::toJSON (const CompletionList &L)
 
llvm::json::Value clang::clangd::toJSON (const ParameterInformation &PI)
 
llvm::json::Value clang::clangd::toJSON (const SignatureInformation &SI)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &O, const SignatureInformation &I)
 
llvm::json::Value clang::clangd::toJSON (const SignatureHelp &SH)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, RenameParams &R)
 
llvm::json::Value clang::clangd::toJSON (const DocumentHighlight &DH)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &O, const DocumentHighlight &V)
 
bool clang::clangd::fromJSON (const llvm::json::Value &E, TypeHierarchyDirection &Out)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, TypeHierarchyParams &R)
 
llvm::json::Value clang::clangd::toJSON (const TypeHierarchyItem &I)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &O, const TypeHierarchyItem &I)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, TypeHierarchyItem &I)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, ResolveTypeHierarchyItemParams &P)
 
bool clang::clangd::fromJSON (const llvm::json::Value &Params, ReferenceParams &R)
 
llvm::json::Value clang::clangd::toJSON (const FileStatus &FStatus)
 
bool clang::clangd::operator== (const SemanticHighlightingInformation &Lhs, const SemanticHighlightingInformation &Rhs)
 
llvm::json::Value clang::clangd::toJSON (const SemanticHighlightingInformation &Highlighting)
 
llvm::json::Value clang::clangd::toJSON (const SemanticHighlightingParams &Highlighting)
 

Variables

constexpr auto clang::clangd::CompletionItemKindMin
 
constexpr auto clang::clangd::CompletionItemKindMax
 
constexpr auto clang::clangd::SymbolKindMin = static_cast<size_t>(SymbolKind::File)
 
constexpr auto clang::clangd::SymbolKindMax = static_cast<size_t>(SymbolKind::TypeParameter)