MLIR  19.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...
 
std::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...
 
std::optional< HoverfindHover (const URIForFile &uri, const Position &hoverPos)
 Find a hover description for the given hover position, or std::nullopt 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...
 
std::optional< PDLLViewOutputResultgetPDLLViewOutput (const URIForFile &uri, PDLLViewOutputKind kind)
 Get the output of the given PDLL file, or std::nullopt 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 39 of file PDLLServer.h.

Constructor & Destructor Documentation

◆ PDLLServer()

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

Definition at line 1705 of file PDLLServer.cpp.

◆ ~PDLLServer()

lsp::PDLLServer::~PDLLServer ( )
default

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 1709 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 1776 of file PDLLServer.cpp.

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

◆ findHover()

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

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

Definition at line 1768 of file PDLLServer.cpp.

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

◆ 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 1753 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 1784 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 1761 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 1800 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 1745 of file PDLLServer.cpp.

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

◆ getPDLLViewOutput()

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

Get the output of the given PDLL file, or std::nullopt if there is no valid output.

Definition at line 1814 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 1792 of file PDLLServer.cpp.

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

◆ removeDocument()

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

Remove the document with the given uri.

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

Definition at line 1735 of file PDLLServer.cpp.

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

◆ 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 1721 of file PDLLServer.cpp.

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


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