LLVM 22.0.0git
Protocol.h File Reference
#include "llvm/Support/JSON.h"
#include "llvm/Support/LogicalResult.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include <bitset>
#include <optional>
#include <string>
#include <utility>

Go to the source code of this file.

Classes

class  llvm::lsp::LSPError
 This class models an LSP error as an llvm::Error. More...
class  llvm::lsp::URIForFile
 URI in "file" scheme for a file. More...
struct  llvm::lsp::ClientCapabilities
struct  llvm::lsp::ClientInfo
struct  llvm::lsp::InitializeParams
struct  llvm::lsp::NoParams
struct  llvm::lsp::TextDocumentItem
struct  llvm::lsp::TextDocumentIdentifier
struct  llvm::lsp::VersionedTextDocumentIdentifier
struct  llvm::lsp::Position
struct  llvm::lsp::Range
struct  llvm::lsp::Location
struct  llvm::lsp::TextDocumentPositionParams
struct  llvm::lsp::ReferenceContext
struct  llvm::lsp::ReferenceParams
struct  llvm::lsp::DidOpenTextDocumentParams
struct  llvm::lsp::DidCloseTextDocumentParams
struct  llvm::lsp::TextDocumentContentChangeEvent
struct  llvm::lsp::DidChangeTextDocumentParams
struct  llvm::lsp::MarkupContent
struct  llvm::lsp::Hover
struct  llvm::lsp::DocumentSymbol
 Represents programming constructs like variables, classes, interfaces etc. More...
struct  llvm::lsp::DocumentSymbolParams
struct  llvm::lsp::DiagnosticRelatedInformation
 Represents a related message and source code location for a diagnostic. More...
struct  llvm::lsp::Diagnostic
struct  llvm::lsp::PublishDiagnosticsParams
struct  llvm::lsp::TextEdit
struct  llvm::lsp::CompletionItem
struct  llvm::lsp::CompletionList
 Represents a collection of completion items to be presented in the editor. More...
struct  llvm::lsp::CompletionContext
struct  llvm::lsp::CompletionParams
struct  llvm::lsp::ParameterInformation
 A single parameter of a particular signature. More...
struct  llvm::lsp::SignatureInformation
 Represents the signature of something callable. More...
struct  llvm::lsp::SignatureHelp
 Represents the signature of a callable. More...
struct  llvm::lsp::DocumentLinkParams
 Parameters for the document link request. More...
 A range in a text document that links to an internal or external resource, like another text document or a web site. More...
struct  llvm::lsp::InlayHintsParams
 A parameter literal used in inlay hint requests. More...
struct  llvm::lsp::InlayHint
 Inlay hint information. More...
struct  llvm::lsp::CodeActionContext
struct  llvm::lsp::CodeActionParams
struct  llvm::lsp::WorkspaceEdit
struct  llvm::lsp::CodeAction
 A code action represents a change that can be performed in code, e.g. More...
struct  llvm::format_provider< llvm::lsp::Position >

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::lsp

Typedefs

using llvm::lsp::InitializedParams = NoParams
using llvm::lsp::CompletionItemKindBitset = std::bitset<kCompletionItemKindMax + 1>

Enumerations

enum class  llvm::lsp::ErrorCode {
  llvm::lsp::ParseError = -32700 , llvm::lsp::InvalidRequest = -32600 , llvm::lsp::MethodNotFound = -32601 , llvm::lsp::InvalidParams = -32602 ,
  llvm::lsp::InternalError = -32603 , llvm::lsp::ServerNotInitialized = -32002 , llvm::lsp::UnknownErrorCode = -32001 , llvm::lsp::RequestCancelled = -32800 ,
  llvm::lsp::ContentModified = -32801 , llvm::lsp::RequestFailed = -32803
}
enum class  llvm::lsp::TextDocumentSyncKind { llvm::lsp::None = 0 , llvm::lsp::Full = 1 , llvm::lsp::Incremental = 2 }
 Defines how the host (editor) should sync document changes to the language server. More...
enum class  llvm::lsp::TraceLevel { llvm::lsp::Off = 0 , llvm::lsp::Messages = 1 , llvm::lsp::Verbose = 2 }
enum class  llvm::lsp::MarkupKind { llvm::lsp::PlainText , llvm::lsp::Markdown }
 Describes the content type that a client supports in various result literals like Hover. More...
enum class  llvm::lsp::SymbolKind {
  llvm::lsp::File = 1 , llvm::lsp::Module = 2 , llvm::lsp::Namespace = 3 , llvm::lsp::Package = 4 ,
  llvm::lsp::Class = 5 , llvm::lsp::Method = 6 , llvm::lsp::Property = 7 , llvm::lsp::Field = 8 ,
  llvm::lsp::Constructor = 9 , llvm::lsp::Enum = 10 , llvm::lsp::Interface = 11 , llvm::lsp::Function = 12 ,
  llvm::lsp::Variable = 13 , llvm::lsp::Constant = 14 , llvm::lsp::String = 15 , llvm::lsp::Number = 16 ,
  llvm::lsp::Boolean = 17 , llvm::lsp::Array = 18 , llvm::lsp::Object = 19 , llvm::lsp::Key = 20 ,
  llvm::lsp::Null = 21 , llvm::lsp::EnumMember = 22 , llvm::lsp::Struct = 23 , llvm::lsp::Event = 24 ,
  llvm::lsp::Operator = 25 , llvm::lsp::TypeParameter = 26
}
enum class  llvm::lsp::DiagnosticSeverity {
  llvm::lsp::Undetermined = 0 , llvm::lsp::Error = 1 , llvm::lsp::Warning = 2 , llvm::lsp::Information = 3 ,
  llvm::lsp::Hint = 4
}
enum class  llvm::lsp::DiagnosticTag { llvm::lsp::Unnecessary = 1 , llvm::lsp::Deprecated = 2 }
enum class  llvm::lsp::CompletionItemKind {
  llvm::lsp::Missing = 0 , llvm::lsp::Text = 1 , llvm::lsp::Method = 2 , llvm::lsp::Function = 3 ,
  llvm::lsp::Constructor = 4 , llvm::lsp::Field = 5 , llvm::lsp::Variable = 6 , llvm::lsp::Class = 7 ,
  llvm::lsp::Interface = 8 , llvm::lsp::Module = 9 , llvm::lsp::Property = 10 , llvm::lsp::Unit = 11 ,
  llvm::lsp::Value = 12 , llvm::lsp::Enum = 13 , llvm::lsp::Keyword = 14 , llvm::lsp::Snippet = 15 ,
  llvm::lsp::Color = 16 , llvm::lsp::File = 17 , llvm::lsp::Reference = 18 , llvm::lsp::Folder = 19 ,
  llvm::lsp::EnumMember = 20 , llvm::lsp::Constant = 21 , llvm::lsp::Struct = 22 , llvm::lsp::Event = 23 ,
  llvm::lsp::Operator = 24 , llvm::lsp::TypeParameter = 25
}
 The kind of a completion entry. More...
enum class  llvm::lsp::InsertTextFormat { llvm::lsp::Missing = 0 , llvm::lsp::PlainText = 1 , llvm::lsp::Snippet = 2 }
 Defines whether the insert text in a completion item should be interpreted as plain text or a snippet. More...
enum class  llvm::lsp::CompletionTriggerKind { llvm::lsp::Invoked = 1 , llvm::lsp::TriggerCharacter = 2 , llvm::lsp::TriggerTriggerForIncompleteCompletions = 3 }
enum class  llvm::lsp::InlayHintKind { llvm::lsp::Type = 1 , llvm::lsp::Parameter = 2 }
 Inlay hint kinds. More...

Functions

llvm::json::Value llvm::lsp::toJSON (const URIForFile &value)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, URIForFile &result, llvm::json::Path path)
raw_ostreamllvm::lsp::operator<< (raw_ostream &os, const URIForFile &value)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, ClientCapabilities &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, ClientInfo &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, TraceLevel &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, InitializeParams &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &, NoParams &, llvm::json::Path)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, TextDocumentItem &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const TextDocumentIdentifier &value)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, TextDocumentIdentifier &result, llvm::json::Path path)
llvm::json::Value llvm::lsp::toJSON (const VersionedTextDocumentIdentifier &value)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, VersionedTextDocumentIdentifier &result, llvm::json::Path path)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, Position &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const Position &value)
raw_ostreamllvm::lsp::operator<< (raw_ostream &os, const Position &value)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, Range &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const Range &value)
raw_ostreamllvm::lsp::operator<< (raw_ostream &os, const Range &value)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, Location &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const Location &value)
raw_ostreamllvm::lsp::operator<< (raw_ostream &os, const Location &value)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, TextDocumentPositionParams &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, ReferenceContext &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, ReferenceParams &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, DidOpenTextDocumentParams &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, DidCloseTextDocumentParams &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, TextDocumentContentChangeEvent &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, DidChangeTextDocumentParams &result, llvm::json::Path path)
 Add support for JSON serialization.
raw_ostreamllvm::lsp::operator<< (raw_ostream &os, MarkupKind kind)
llvm::json::Value llvm::lsp::toJSON (const MarkupContent &mc)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const Hover &hover)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const DocumentSymbol &symbol)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, DocumentSymbolParams &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, DiagnosticRelatedInformation &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const DiagnosticRelatedInformation &info)
llvm::json::Value llvm::lsp::toJSON (DiagnosticTag tag)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, DiagnosticTag &result, llvm::json::Path path)
llvm::json::Value llvm::lsp::toJSON (const Diagnostic &diag)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, Diagnostic &result, llvm::json::Path path)
llvm::json::Value llvm::lsp::toJSON (const PublishDiagnosticsParams &params)
 Add support for JSON serialization.
bool llvm::lsp::operator== (const TextEdit &lhs, const TextEdit &rhs)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, TextEdit &result, llvm::json::Path path)
llvm::json::Value llvm::lsp::toJSON (const TextEdit &value)
raw_ostreamllvm::lsp::operator<< (raw_ostream &os, const TextEdit &value)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, CompletionItemKind &result, llvm::json::Path path)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, CompletionItemKindBitset &result, llvm::json::Path path)
CompletionItemKind llvm::lsp::adjustKindToCapability (CompletionItemKind kind, CompletionItemKindBitset &supportedCompletionItemKinds)
llvm::json::Value llvm::lsp::toJSON (const CompletionItem &value)
 Add support for JSON serialization.
raw_ostreamllvm::lsp::operator<< (raw_ostream &os, const CompletionItem &value)
bool llvm::lsp::operator< (const CompletionItem &lhs, const CompletionItem &rhs)
llvm::json::Value llvm::lsp::toJSON (const CompletionList &value)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, CompletionContext &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, CompletionParams &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const ParameterInformation &value)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const SignatureInformation &value)
 Add support for JSON serialization.
raw_ostreamllvm::lsp::operator<< (raw_ostream &os, const SignatureInformation &value)
llvm::json::Value llvm::lsp::toJSON (const SignatureHelp &value)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, DocumentLinkParams &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const DocumentLink &value)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, InlayHintsParams &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const InlayHint &)
 Add support for JSON serialization.
bool llvm::lsp::operator== (const InlayHint &lhs, const InlayHint &rhs)
bool llvm::lsp::operator< (const InlayHint &lhs, const InlayHint &rhs)
llvm::raw_ostreamllvm::lsp::operator<< (llvm::raw_ostream &os, InlayHintKind value)
bool llvm::lsp::fromJSON (const llvm::json::Value &value, CodeActionContext &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, CodeActionParams &result, llvm::json::Path path)
 Add support for JSON serialization.
bool llvm::lsp::fromJSON (const llvm::json::Value &value, WorkspaceEdit &result, llvm::json::Path path)
 Add support for JSON serialization.
llvm::json::Value llvm::lsp::toJSON (const WorkspaceEdit &value)
llvm::json::Value llvm::lsp::toJSON (const CodeAction &)
 Add support for JSON serialization.

Variables

constexpr auto llvm::lsp::kCompletionItemKindMin
constexpr auto llvm::lsp::kCompletionItemKindMax