MLIR  16.0.0git
Classes | Public Member Functions | List of all members
mlir::lsp::PDLLServer Class Reference

This class implements all of the PDLL related functionality necessary for a language server. More...

#include "Tools/mlir-pdll-lsp-server/PDLLServer.h"

Classes

struct  Impl
 
struct  Options
 

Public Member Functions

 PDLLServer (const Options &options)
 
 ~PDLLServer ()
 
void addDocument (const URIForFile &uri, StringRef contents, int64_t version, std::vector< Diagnostic > &diagnostics)
 Add the document, with the provided version, at the given URI. More...
 
void updateDocument (const URIForFile &uri, ArrayRef< TextDocumentContentChangeEvent > changes, int64_t version, std::vector< Diagnostic > &diagnostics)
 Update the document, with the provided version, at the given URI. More...
 
Optional< int64_t > removeDocument (const URIForFile &uri)
 Remove the document with the given uri. More...
 
void getLocationsOf (const URIForFile &uri, const Position &defPos, std::vector< Location > &locations)
 Return the locations of the object pointed at by the given position. More...
 
void findReferencesOf (const URIForFile &uri, const Position &pos, std::vector< Location > &references)
 Find all references of the object pointed at by the given position. More...
 
void getDocumentLinks (const URIForFile &uri, std::vector< DocumentLink > &documentLinks)
 Return the document links referenced by the given file. More...
 
Optional< HoverfindHover (const URIForFile &uri, const Position &hoverPos)
 Find a hover description for the given hover position, or None if one couldn't be found. More...
 
void findDocumentSymbols (const URIForFile &uri, std::vector< DocumentSymbol > &symbols)
 Find all of the document symbols within the given file. More...
 
CompletionList getCodeCompletion (const URIForFile &uri, const Position &completePos)
 Get the code completion list for the position within the given file. More...
 
SignatureHelp getSignatureHelp (const URIForFile &uri, const Position &helpPos)
 Get the signature help for the position within the given file. More...
 
void getInlayHints (const URIForFile &uri, const Range &range, std::vector< InlayHint > &inlayHints)
 Get the inlay hints for the range within the given file. More...
 
Optional< PDLLViewOutputResultgetPDLLViewOutput (const URIForFile &uri, PDLLViewOutputKind kind)
 Get the output of the given PDLL file, or None if there is no valid output. More...
 

Detailed Description

This class implements all of the PDLL related functionality necessary for a language server.

This class allows for keeping the PDLL specific logic separate from the logic that involves LSP server/client communication.

Definition at line 38 of file PDLLServer.h.

Constructor & Destructor Documentation

◆ PDLLServer()

lsp::PDLLServer::PDLLServer ( const Options options)

Definition at line 1752 of file PDLLServer.cpp.

References ~PDLLServer().

◆ ~PDLLServer()

lsp::PDLLServer::~PDLLServer ( )
default

Referenced by PDLLServer().

Member Function Documentation

◆ addDocument()

void lsp::PDLLServer::addDocument ( const URIForFile uri,
StringRef  contents,
int64_t  version,
std::vector< Diagnostic > &  diagnostics 
)

Add the document, with the provided version, at the given URI.

Any diagnostics emitted for this document should be added to diagnostics.

Definition at line 1756 of file PDLLServer.cpp.

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

◆ findDocumentSymbols()

void lsp::PDLLServer::findDocumentSymbols ( const URIForFile uri,
std::vector< DocumentSymbol > &  symbols 
)

Find all of the document symbols within the given file.

Definition at line 1823 of file PDLLServer.cpp.

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

◆ findHover()

Optional< lsp::Hover > lsp::PDLLServer::findHover ( const URIForFile uri,
const Position hoverPos 
)

Find a hover description for the given hover position, or None if one couldn't be found.

Definition at line 1815 of file PDLLServer.cpp.

References mlir::lsp::URIForFile::file(), and mlir::lsp::None.

◆ findReferencesOf()

void lsp::PDLLServer::findReferencesOf ( const URIForFile uri,
const Position pos,
std::vector< Location > &  references 
)

Find all references of the object pointed at by the given position.

Definition at line 1800 of file PDLLServer.cpp.

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

◆ getCodeCompletion()

lsp::CompletionList lsp::PDLLServer::getCodeCompletion ( const URIForFile uri,
const Position completePos 
)

Get the code completion list for the position within the given file.

Definition at line 1831 of file PDLLServer.cpp.

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

◆ getDocumentLinks()

void lsp::PDLLServer::getDocumentLinks ( const URIForFile uri,
std::vector< DocumentLink > &  documentLinks 
)

Return the document links referenced by the given file.

Definition at line 1808 of file PDLLServer.cpp.

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

◆ getInlayHints()

void lsp::PDLLServer::getInlayHints ( const URIForFile uri,
const Range range,
std::vector< InlayHint > &  inlayHints 
)

Get the inlay hints for the range within the given file.

Definition at line 1847 of file PDLLServer.cpp.

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

◆ getLocationsOf()

void lsp::PDLLServer::getLocationsOf ( const URIForFile uri,
const Position defPos,
std::vector< Location > &  locations 
)

Return the locations of the object pointed at by the given position.

Definition at line 1792 of file PDLLServer.cpp.

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

◆ getPDLLViewOutput()

Optional< lsp::PDLLViewOutputResult > lsp::PDLLServer::getPDLLViewOutput ( const URIForFile uri,
PDLLViewOutputKind  kind 
)

Get the output of the given PDLL file, or None if there is no valid output.

Definition at line 1861 of file PDLLServer.cpp.

◆ getSignatureHelp()

lsp::SignatureHelp lsp::PDLLServer::getSignatureHelp ( const URIForFile uri,
const Position helpPos 
)

Get the signature help for the position within the given file.

Definition at line 1839 of file PDLLServer.cpp.

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

◆ removeDocument()

Optional< int64_t > lsp::PDLLServer::removeDocument ( const URIForFile uri)

Remove the document with the given uri.

Returns the version of the removed document, or None if the uri did not have a corresponding document within the server.

Definition at line 1782 of file PDLLServer.cpp.

References mlir::lsp::URIForFile::file(), and mlir::lsp::None.

◆ updateDocument()

void lsp::PDLLServer::updateDocument ( const URIForFile uri,
ArrayRef< TextDocumentContentChangeEvent changes,
int64_t  version,
std::vector< Diagnostic > &  diagnostics 
)

Update the document, with the provided version, at the given URI.

Any diagnostics emitted for this document should be added to diagnostics.

Definition at line 1768 of file PDLLServer.cpp.

References mlir::failed(), and mlir::lsp::URIForFile::file().


The documentation for this class was generated from the following files: