MLIR  15.0.0git
Classes | Typedefs | Enumerations | Functions | Variables
mlir::lsp Namespace Reference

Classes

struct  ClientCapabilities
 
class  CompilationDatabase
 This class contains a collection of compilation information for files provided to the language server, such as the available include directories. More...
 
struct  CompletionContext
 
struct  CompletionItem
 
struct  CompletionList
 Represents a collection of completion items to be presented in the editor. More...
 
struct  CompletionParams
 
struct  Diagnostic
 
struct  DiagnosticRelatedInformation
 Represents a related message and source code location for a diagnostic. More...
 
struct  DidChangeTextDocumentParams
 
struct  DidCloseTextDocumentParams
 
struct  DidOpenTextDocumentParams
 
struct  DocumentLink
 A range in a text document that links to an internal or external resource, like another text document or a web site. More...
 
struct  DocumentLinkParams
 Parameters for the document link request. More...
 
struct  DocumentSymbol
 Represents programming constructs like variables, classes, interfaces etc. More...
 
struct  DocumentSymbolParams
 
struct  Hover
 
struct  InitializeParams
 
struct  InlayHint
 Inlay hint information. More...
 
struct  InlayHintsParams
 A parameter literal used in inlay hint requests. More...
 
class  JSONTransport
 A transport class that performs the JSON-RPC communication with the LSP client. More...
 
struct  Location
 
class  Logger
 This class represents the main interface for logging, and allows for filtering logging based on different levels of severity or significance. More...
 
class  LSPError
 This class models an LSP error as an llvm::Error. More...
 
class  LSPServer
 This class represents the main LSP server, and handles communication with the LSP client. More...
 
struct  MarkupContent
 
class  MessageHandler
 A handler used to process the incoming transport messages. More...
 
class  MLIRServer
 This class implements all of the MLIR related functionality necessary for a language server. More...
 
struct  NoParams
 
struct  ParameterInformation
 A single parameter of a particular signature. More...
 
class  PDLLServer
 This class implements all of the PDLL related functionality necessary for a language server. More...
 
struct  PDLLViewOutputParams
 Represents the parameters used when viewing the output of a PDLL file. More...
 
struct  PDLLViewOutputResult
 Represents the result of viewing the output of a PDLL file. More...
 
struct  Position
 
struct  PublishDiagnosticsParams
 
struct  Range
 
struct  ReferenceContext
 
struct  ReferenceParams
 
struct  SignatureHelp
 Represents the signature of a callable. More...
 
struct  SignatureInformation
 Represents the signature of something callable. More...
 
struct  SourceMgrInclude
 This class represents a single include within a root file. More...
 
class  TableGenServer
 This class implements all of the TableGen related functionality necessary for a language server. More...
 
struct  TextDocumentContentChangeEvent
 
struct  TextDocumentIdentifier
 
struct  TextDocumentItem
 
struct  TextDocumentPositionParams
 
struct  TextEdit
 
class  URIForFile
 URI in "file" scheme for a file. More...
 
struct  VersionedTextDocumentIdentifier
 

Typedefs

using InitializedParams = NoParams
 
using CompletionItemKindBitset = std::bitset< kCompletionItemKindMax+1 >
 
template<typename T >
using Callback = llvm::unique_function< void(llvm::Expected< T >)>
 A Callback<T> is a void function that accepts Expected<T>. More...
 
template<typename T >
using OutgoingNotification = llvm::unique_function< void(const T &)>
 An OutgoingNotification<T> is a function used for outgoing notifications send to the client. More...
 

Enumerations

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

Functions

llvm::json::Value toJSON (const URIForFile &value)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, URIForFile &result, llvm::json::Path path)
 
raw_ostream & operator<< (raw_ostream &os, const URIForFile &value)
 
bool fromJSON (const llvm::json::Value &value, ClientCapabilities &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, TraceLevel &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, InitializeParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &, NoParams &, llvm::json::Path)
 
bool fromJSON (const llvm::json::Value &value, TextDocumentItem &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const TextDocumentIdentifier &value)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, TextDocumentIdentifier &result, llvm::json::Path path)
 
llvm::json::Value toJSON (const VersionedTextDocumentIdentifier &value)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, VersionedTextDocumentIdentifier &result, llvm::json::Path path)
 
bool fromJSON (const llvm::json::Value &value, Position &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const Position &value)
 
raw_ostream & operator<< (raw_ostream &os, const Position &value)
 
bool fromJSON (const llvm::json::Value &value, Range &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const Range &value)
 
raw_ostream & operator<< (raw_ostream &os, const Range &value)
 
llvm::json::Value toJSON (const Location &value)
 Add support for JSON serialization. More...
 
raw_ostream & operator<< (raw_ostream &os, const Location &value)
 
bool fromJSON (const llvm::json::Value &value, TextDocumentPositionParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, ReferenceContext &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, ReferenceParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, DidOpenTextDocumentParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, DidCloseTextDocumentParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, TextDocumentContentChangeEvent &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, DidChangeTextDocumentParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
raw_ostream & operator<< (raw_ostream &os, MarkupKind kind)
 
llvm::json::Value toJSON (const MarkupContent &mc)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const Hover &hover)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const DocumentSymbol &symbol)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, DocumentSymbolParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const DiagnosticRelatedInformation &info)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const Diagnostic &diag)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const PublishDiagnosticsParams &params)
 Add support for JSON serialization. More...
 
bool operator== (const TextEdit &lhs, const TextEdit &rhs)
 
bool fromJSON (const llvm::json::Value &value, TextEdit &result, llvm::json::Path path)
 
llvm::json::Value toJSON (const TextEdit &value)
 
raw_ostream & operator<< (raw_ostream &os, const TextEdit &value)
 
bool fromJSON (const llvm::json::Value &value, CompletionItemKind &result, llvm::json::Path path)
 
bool fromJSON (const llvm::json::Value &value, CompletionItemKindBitset &result, llvm::json::Path path)
 
CompletionItemKind adjustKindToCapability (CompletionItemKind kind, CompletionItemKindBitset &supportedCompletionItemKinds)
 
llvm::json::Value toJSON (const CompletionItem &value)
 Add support for JSON serialization. More...
 
raw_ostream & operator<< (raw_ostream &os, const CompletionItem &value)
 
bool operator< (const CompletionItem &lhs, const CompletionItem &rhs)
 
llvm::json::Value toJSON (const CompletionList &value)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, CompletionContext &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, CompletionParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const ParameterInformation &value)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const SignatureInformation &value)
 Add support for JSON serialization. More...
 
raw_ostream & operator<< (raw_ostream &os, const SignatureInformation &value)
 
llvm::json::Value toJSON (const SignatureHelp &value)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, DocumentLinkParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const DocumentLink &value)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, InlayHintsParams &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
llvm::json::Value toJSON (const InlayHint &)
 Add support for JSON serialization. More...
 
bool operator== (const InlayHint &lhs, const InlayHint &rhs)
 
bool operator< (const InlayHint &lhs, const InlayHint &rhs)
 
llvm::raw_ostream & operator<< (llvm::raw_ostream &os, InlayHintKind value)
 
SMRange convertTokenLocToRange (SMLoc loc)
 Returns the range of a lexical token given a SMLoc corresponding to the start of an token location. More...
 
void gatherIncludeFiles (llvm::SourceMgr &sourceMgr, SmallVectorImpl< SourceMgrInclude > &includes)
 Given a source manager, gather all of the processed include files. More...
 
LogicalResult runPdllLSPServer (PDLLServer &server, JSONTransport &transport)
 Run the main loop of the LSP server using the given PDLL server and transport. More...
 
bool fromJSON (const llvm::json::Value &value, PDLLViewOutputKind &result, llvm::json::Path path)
 Add support for JSON serialization. More...
 
bool fromJSON (const llvm::json::Value &value, PDLLViewOutputParams &result, llvm::json::Path path)
 
llvm::json::Value toJSON (const PDLLViewOutputResult &value)
 Add support for JSON serialization. More...
 
LogicalResult runTableGenLSPServer (TableGenServer &server, JSONTransport &transport)
 Run the main loop of the LSP server using the given TableGen server and transport. More...
 

Variables

constexpr auto kCompletionItemKindMin
 
constexpr auto kCompletionItemKindMax
 

Typedef Documentation

◆ Callback

template<typename T >
using mlir::lsp::Callback = typedef llvm::unique_function<void(llvm::Expected<T>)>

A Callback<T> is a void function that accepts Expected<T>.

This is accepted by functions that logically return T.

Definition at line 96 of file Transport.h.

◆ CompletionItemKindBitset

Definition at line 752 of file Protocol.h.

◆ InitializedParams

Definition at line 189 of file Protocol.h.

◆ OutgoingNotification

template<typename T >
using mlir::lsp::OutgoingNotification = typedef llvm::unique_function<void(const T &)>

An OutgoingNotification<T> is a function used for outgoing notifications send to the client.

Definition at line 101 of file Transport.h.

Enumeration Type Documentation

◆ CompletionItemKind

The kind of a completion entry.

Enumerator
Missing 
Text 
Method 
Function 
Constructor 
Field 
Variable 
Class 
Interface 
Module 
Property 
Unit 
Value 
Enum 
Keyword 
Snippet 
Color 
File 
Reference 
Folder 
EnumMember 
Constant 
Struct 
Event 
Operator 
TypeParameter 

Definition at line 717 of file Protocol.h.

◆ CompletionTriggerKind

Enumerator
Invoked 

Completion was triggered by typing an identifier (24x7 code complete), manual invocation (e.g Ctrl+Space) or via API.

TriggerCharacter 

Completion was triggered by a trigger character specified by the triggerCharacters properties of the CompletionRegistrationOptions.

TriggerTriggerForIncompleteCompletions 

Completion was re-triggered as the current completion list is incomplete.

Definition at line 856 of file Protocol.h.

◆ DiagnosticSeverity

Enumerator
Undetermined 

It is up to the client to interpret diagnostics as error, warning, info or hint.

Error 
Warning 
Information 
Hint 

Definition at line 631 of file Protocol.h.

◆ ErrorCode

enum mlir::lsp::ErrorCode
strong
Enumerator
ParseError 
InvalidRequest 
MethodNotFound 
InvalidParams 
InternalError 
ServerNotInitialized 
UnknownErrorCode 
RequestCancelled 
ContentModified 

Definition at line 42 of file Protocol.h.

◆ InlayHintKind

Inlay hint kinds.

Enumerator
Type 

An inlay hint that for a type annotation.

An example of a type hint is a hint in this position: auto var ^ = expr; which shows the deduced type of the variable.

Parameter 

An inlay hint that is for a parameter.

An example of a parameter hint is a hint in this position: func(^arg); which shows the name of the corresponding parameter.

Definition at line 1025 of file Protocol.h.

◆ InsertTextFormat

Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.

Enumerator
Missing 
PlainText 

The primary text to be inserted is treated as a plain string.

Snippet 

The primary text to be inserted is treated as a snippet.

A snippet can define tab stops and placeholders with $1, $2 and ${3:foo}. $0 defines the final tab stop, it defaults to the end of the snippet. Placeholders with equal identifiers are linked, that is typing in one will update others too.

See also: https//github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md

Definition at line 766 of file Protocol.h.

◆ JSONStreamStyle

The encoding style of the JSON-RPC messages (both input and output).

Enumerator
Standard 

Encoding per the LSP specification, with mandatory Content-Length header.

Delimited 

Messages are delimited by a '// --—' line. Comment lines start with //.

Definition at line 39 of file Transport.h.

◆ MarkupKind

enum mlir::lsp::MarkupKind
strong

Describes the content type that a client supports in various result literals like Hover.

Enumerator
PlainText 
Markdown 

Definition at line 486 of file Protocol.h.

◆ PDLLViewOutputKind

The type of output to view from PDLL.

Enumerator
AST 
MLIR 
CPP 

Definition at line 32 of file Protocol.h.

◆ SymbolKind

enum mlir::lsp::SymbolKind
strong
Enumerator
File 
Module 
Namespace 
Package 
Class 
Method 
Property 
Field 
Constructor 
Enum 
Interface 
Function 
Variable 
Constant 
String 
Number 
Boolean 
Array 
Object 
Key 
Null 
EnumMember 
Struct 
Event 
Operator 
TypeParameter 

Definition at line 523 of file Protocol.h.

◆ TextDocumentSyncKind

Defines how the host (editor) should sync document changes to the language server.

Enumerator
None 

Documents should not be synced at all.

Full 

Documents are synced by always sending the full content of the document.

Incremental 

Documents are synced by sending the full content on open.

After that only incremental updates to the document are sent.

Definition at line 60 of file Protocol.h.

◆ TraceLevel

enum mlir::lsp::TraceLevel
strong
Enumerator
Off 
Messages 
Verbose 

Definition at line 159 of file Protocol.h.

Function Documentation

◆ adjustKindToCapability()

CompletionItemKind mlir::lsp::adjustKindToCapability ( CompletionItemKind  kind,
CompletionItemKindBitset supportedCompletionItemKinds 
)

Definition at line 661 of file Protocol.cpp.

◆ convertTokenLocToRange()

SMRange mlir::lsp::convertTokenLocToRange ( SMLoc  loc)

Returns the range of a lexical token given a SMLoc corresponding to the start of an token location.

The range is computed heuristically, and supports identifier-like tokens, strings, etc.

Definition at line 45 of file SourceMgrUtils.cpp.

References lexLocStringTok().

Referenced by getLocationFromLoc(), and getLspDiagnoticFromDiag().

◆ fromJSON() [1/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
PDLLViewOutputKind result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 46 of file Protocol.cpp.

References AST, CPP, and MLIR.

◆ fromJSON() [2/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
PDLLViewOutputParams result,
llvm::json::Path  path 
)

◆ fromJSON() [3/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
URIForFile result,
llvm::json::Path  path 
)

◆ fromJSON() [4/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
ClientCapabilities result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 256 of file Protocol.cpp.

References mlir::lsp::ClientCapabilities::hierarchicalDocumentSymbol.

◆ fromJSON() [5/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
TraceLevel result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 278 of file Protocol.cpp.

References Messages, Off, and Verbose.

◆ fromJSON() [6/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
InitializeParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 297 of file Protocol.cpp.

References mlir::lsp::InitializeParams::capabilities, and mlir::lsp::InitializeParams::trace.

◆ fromJSON() [7/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  ,
NoParams ,
llvm::json::Path   
)
inline

Definition at line 186 of file Protocol.h.

◆ fromJSON() [8/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
TextDocumentItem result,
llvm::json::Path  path 
)

◆ fromJSON() [9/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
TextDocumentIdentifier result,
llvm::json::Path  path 
)

Definition at line 328 of file Protocol.cpp.

References mlir::lsp::TextDocumentIdentifier::uri.

◆ fromJSON() [10/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
VersionedTextDocumentIdentifier result,
llvm::json::Path  path 
)

◆ fromJSON() [11/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
Position result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 358 of file Protocol.cpp.

References mlir::lsp::Position::character, and mlir::lsp::Position::line.

◆ fromJSON() [12/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
Range result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 380 of file Protocol.cpp.

References mlir::lsp::Range::end, and mlir::lsp::Range::start.

◆ fromJSON() [13/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
TextDocumentPositionParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 416 of file Protocol.cpp.

References mlir::lsp::TextDocumentPositionParams::position, and mlir::lsp::TextDocumentPositionParams::textDocument.

◆ fromJSON() [14/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
ReferenceContext result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 428 of file Protocol.cpp.

References mlir::lsp::ReferenceContext::includeDeclaration.

◆ fromJSON() [15/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
ReferenceParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 434 of file Protocol.cpp.

References mlir::lsp::ReferenceParams::context, and fromJSON().

◆ fromJSON() [16/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
DidOpenTextDocumentParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 446 of file Protocol.cpp.

References mlir::lsp::DidOpenTextDocumentParams::textDocument.

◆ fromJSON() [17/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
DidCloseTextDocumentParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 457 of file Protocol.cpp.

References mlir::lsp::DidCloseTextDocumentParams::textDocument.

◆ fromJSON() [18/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
TextDocumentContentChangeEvent result,
llvm::json::Path  path 
)

◆ fromJSON() [19/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
DidChangeTextDocumentParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 506 of file Protocol.cpp.

References mlir::lsp::DidChangeTextDocumentParams::contentChanges, and mlir::lsp::DidChangeTextDocumentParams::textDocument.

◆ fromJSON() [20/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
DocumentSymbolParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 574 of file Protocol.cpp.

References mlir::lsp::DocumentSymbolParams::textDocument.

◆ fromJSON() [21/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
TextEdit result,
llvm::json::Path  path 
)

Definition at line 626 of file Protocol.cpp.

References mlir::lsp::TextEdit::newText, and mlir::lsp::TextEdit::range.

◆ fromJSON() [22/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
CompletionItemKind result,
llvm::json::Path  path 
)

Definition at line 649 of file Protocol.cpp.

References Text, and TypeParameter.

◆ fromJSON() [23/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
CompletionItemKindBitset result,
llvm::json::Path  path 
)

Definition at line 683 of file Protocol.cpp.

References fromJSON().

◆ fromJSON() [24/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
CompletionContext result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 755 of file Protocol.cpp.

References mapOptOrNull(), mlir::lsp::CompletionContext::triggerCharacter, and mlir::lsp::CompletionContext::triggerKind.

◆ fromJSON() [25/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
CompletionParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 770 of file Protocol.cpp.

References mlir::lsp::CompletionParams::context, and fromJSON().

◆ fromJSON() [26/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
DocumentLinkParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 837 of file Protocol.cpp.

References mlir::lsp::DocumentLinkParams::textDocument.

◆ fromJSON() [27/27]

bool mlir::lsp::fromJSON ( const llvm::json::Value &  value,
InlayHintsParams result,
llvm::json::Path  path 
)

Add support for JSON serialization.

Definition at line 858 of file Protocol.cpp.

References mlir::lsp::InlayHintsParams::range, and mlir::lsp::InlayHintsParams::textDocument.

◆ gatherIncludeFiles()

void mlir::lsp::gatherIncludeFiles ( llvm::SourceMgr &  sourceMgr,
SmallVectorImpl< SourceMgrInclude > &  includes 
)

Given a source manager, gather all of the processed include files.

These are assumed to be all of the files other than the main root file.

Definition at line 82 of file SourceMgrUtils.cpp.

References mlir::lsp::URIForFile::fromFile().

Referenced by getLspDiagnoticFromDiag().

◆ operator<() [1/2]

bool mlir::lsp::operator< ( const CompletionItem lhs,
const CompletionItem rhs 
)

Definition at line 734 of file Protocol.cpp.

◆ operator<() [2/2]

bool mlir::lsp::operator< ( const InlayHint lhs,
const InlayHint rhs 
)

Definition at line 880 of file Protocol.cpp.

◆ operator<<() [1/9]

raw_ostream & mlir::lsp::operator<< ( raw_ostream &  os,
const URIForFile value 
)

◆ operator<<() [2/9]

raw_ostream & mlir::lsp::operator<< ( raw_ostream &  os,
const Position value 
)

Definition at line 372 of file Protocol.cpp.

References mlir::lsp::Position::character, and mlir::lsp::Position::line.

◆ operator<<() [3/9]

raw_ostream & mlir::lsp::operator<< ( raw_ostream &  os,
const Range value 
)

Definition at line 393 of file Protocol.cpp.

References mlir::lsp::Range::end, and mlir::lsp::Range::start.

◆ operator<<() [4/9]

raw_ostream & mlir::lsp::operator<< ( raw_ostream &  os,
const Location value 
)

Definition at line 408 of file Protocol.cpp.

References mlir::lsp::Location::range, and mlir::lsp::Location::uri.

◆ operator<<() [5/9]

raw_ostream & mlir::lsp::operator<< ( raw_ostream &  os,
MarkupKind  kind 
)

Definition at line 528 of file Protocol.cpp.

◆ operator<<() [6/9]

raw_ostream & mlir::lsp::operator<< ( raw_ostream &  os,
const TextEdit value 
)

Definition at line 639 of file Protocol.cpp.

References mlir::lsp::TextEdit::newText, and mlir::lsp::TextEdit::range.

◆ operator<<() [7/9]

raw_ostream & mlir::lsp::operator<< ( raw_ostream &  os,
const CompletionItem value 
)

Definition at line 729 of file Protocol.cpp.

References mlir::lsp::CompletionItem::label, and toJSON().

◆ operator<<() [8/9]

raw_ostream & mlir::lsp::operator<< ( raw_ostream &  os,
const SignatureInformation value 
)

Definition at line 812 of file Protocol.cpp.

References mlir::lsp::SignatureInformation::label, and toJSON().

◆ operator<<() [9/9]

llvm::raw_ostream & mlir::lsp::operator<< ( llvm::raw_ostream &  os,
InlayHintKind  value 
)

Definition at line 885 of file Protocol.cpp.

References Parameter, and Type.

◆ operator==() [1/2]

bool mlir::lsp::operator== ( const TextEdit lhs,
const TextEdit rhs 
)
inline

Definition at line 703 of file Protocol.h.

◆ operator==() [2/2]

bool mlir::lsp::operator== ( const InlayHint lhs,
const InlayHint rhs 
)

Definition at line 876 of file Protocol.cpp.

◆ runPdllLSPServer()

LogicalResult mlir::lsp::runPdllLSPServer ( PDLLServer server,
JSONTransport transport 
)

◆ runTableGenLSPServer()

LogicalResult mlir::lsp::runTableGenLSPServer ( TableGenServer server,
JSONTransport transport 
)

◆ toJSON() [1/21]

llvm::json::Value mlir::lsp::toJSON ( const PDLLViewOutputResult value)

Add support for JSON serialization.

Definition at line 75 of file Protocol.cpp.

References mlir::lsp::PDLLViewOutputResult::output.

◆ toJSON() [2/21]

llvm::json::Value mlir::lsp::toJSON ( const URIForFile value)

Add support for JSON serialization.

Definition at line 244 of file Protocol.cpp.

References mlir::lsp::URIForFile::uri().

Referenced by mlir::lsp::Position::getAsSMLoc(), mlir::lsp::Range::getAsSMRange(), operator<<(), and toJSON().

◆ toJSON() [3/21]

llvm::json::Value mlir::lsp::toJSON ( const TextDocumentIdentifier value)

Add support for JSON serialization.

Definition at line 324 of file Protocol.cpp.

References mlir::lsp::TextDocumentIdentifier::uri.

◆ toJSON() [4/21]

llvm::json::Value mlir::lsp::toJSON ( const VersionedTextDocumentIdentifier value)

Add support for JSON serialization.

Definition at line 340 of file Protocol.cpp.

References mlir::lsp::VersionedTextDocumentIdentifier::uri, and mlir::lsp::VersionedTextDocumentIdentifier::version.

◆ toJSON() [5/21]

llvm::json::Value mlir::lsp::toJSON ( const Position value)

Definition at line 365 of file Protocol.cpp.

References mlir::lsp::Position::character, and mlir::lsp::Position::line.

◆ toJSON() [6/21]

llvm::json::Value mlir::lsp::toJSON ( const Range value)

Definition at line 386 of file Protocol.cpp.

References mlir::lsp::Range::end, and mlir::lsp::Range::start.

◆ toJSON() [7/21]

llvm::json::Value mlir::lsp::toJSON ( const Location value)

Add support for JSON serialization.

Definition at line 401 of file Protocol.cpp.

References mlir::lsp::Location::range, and mlir::lsp::Location::uri.

◆ toJSON() [8/21]

llvm::json::Value mlir::lsp::toJSON ( const MarkupContent mc)

Add support for JSON serialization.

Definition at line 532 of file Protocol.cpp.

References mlir::lsp::MarkupContent::kind, toTextKind(), and mlir::lsp::MarkupContent::value.

◆ toJSON() [9/21]

llvm::json::Value mlir::lsp::toJSON ( const Hover hover)

Add support for JSON serialization.

Definition at line 546 of file Protocol.cpp.

References mlir::lsp::Hover::contents, mlir::lsp::Hover::range, and toJSON().

◆ toJSON() [10/21]

llvm::json::Value mlir::lsp::toJSON ( const DocumentSymbol symbol)

◆ toJSON() [11/21]

llvm::json::Value mlir::lsp::toJSON ( const DiagnosticRelatedInformation info)

Add support for JSON serialization.

Definition at line 584 of file Protocol.cpp.

References mlir::lsp::DiagnosticRelatedInformation::location, and mlir::lsp::DiagnosticRelatedInformation::message.

◆ toJSON() [12/21]

llvm::json::Value mlir::lsp::toJSON ( const Diagnostic diag)

◆ toJSON() [13/21]

llvm::json::Value mlir::lsp::toJSON ( const PublishDiagnosticsParams params)

◆ toJSON() [14/21]

llvm::json::Value mlir::lsp::toJSON ( const TextEdit value)

Definition at line 632 of file Protocol.cpp.

References mlir::lsp::TextEdit::newText, and mlir::lsp::TextEdit::range.

◆ toJSON() [15/21]

llvm::json::Value mlir::lsp::toJSON ( const CompletionItem value)

◆ toJSON() [16/21]

llvm::json::Value mlir::lsp::toJSON ( const CompletionList value)

Add support for JSON serialization.

Definition at line 744 of file Protocol.cpp.

References mlir::lsp::CompletionList::isIncomplete, and mlir::lsp::CompletionList::items.

◆ toJSON() [17/21]

llvm::json::Value mlir::lsp::toJSON ( const ParameterInformation value)

◆ toJSON() [18/21]

llvm::json::Value mlir::lsp::toJSON ( const SignatureInformation value)

◆ toJSON() [19/21]

llvm::json::Value mlir::lsp::toJSON ( const SignatureHelp value)

◆ toJSON() [20/21]

llvm::json::Value mlir::lsp::toJSON ( const DocumentLink value)

Add support for JSON serialization.

Definition at line 847 of file Protocol.cpp.

References mlir::lsp::DocumentLink::range, and mlir::lsp::DocumentLink::target.

◆ toJSON() [21/21]

llvm::json::Value mlir::lsp::toJSON ( const InlayHint value)

Variable Documentation

◆ kCompletionItemKindMax

constexpr auto mlir::lsp::kCompletionItemKindMax
Initial value:
=
static_cast<size_t>(CompletionItemKind::TypeParameter)

Definition at line 750 of file Protocol.h.

◆ kCompletionItemKindMin

constexpr auto mlir::lsp::kCompletionItemKindMin
Initial value:
=
static_cast<size_t>(CompletionItemKind::Text)

Definition at line 748 of file Protocol.h.