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

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

#include "Tools/tblgen-lsp-server/TableGenServer.h"

Classes

struct  Impl
 
struct  Options
 

Public Member Functions

 TableGenServer (const Options &options)
 
 ~TableGenServer ()
 
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< Hover > 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. More...
 

Detailed Description

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

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

Definition at line 33 of file TableGenServer.h.

Constructor & Destructor Documentation

◆ TableGenServer()

lsp::TableGenServer::TableGenServer ( const Options options)

Definition at line 673 of file TableGenServer.cpp.

◆ ~TableGenServer()

lsp::TableGenServer::~TableGenServer ( )
default

Member Function Documentation

◆ addDocument()

void lsp::TableGenServer::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 677 of file TableGenServer.cpp.

◆ findHover()

std::optional< llvm::lsp::Hover > lsp::TableGenServer::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 738 of file TableGenServer.cpp.

◆ findReferencesOf()

void lsp::TableGenServer::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 722 of file TableGenServer.cpp.

◆ getDocumentLinks()

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

Return the document links referenced by the given file.

Definition at line 730 of file TableGenServer.cpp.

◆ getLocationsOf()

void lsp::TableGenServer::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 714 of file TableGenServer.cpp.

◆ removeDocument()

std::optional< int64_t > lsp::TableGenServer::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 704 of file TableGenServer.cpp.

◆ updateDocument()

void lsp::TableGenServer::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 689 of file TableGenServer.cpp.

References mlir::remark::failed().


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