MLIR  20.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< 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...
 

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 32 of file TableGenServer.h.

Constructor & Destructor Documentation

◆ TableGenServer()

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

Definition at line 662 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 666 of file TableGenServer.cpp.

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

◆ findHover()

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

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

◆ 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 711 of file TableGenServer.cpp.

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

◆ getDocumentLinks()

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

Return the document links referenced by the given file.

Definition at line 719 of file TableGenServer.cpp.

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

◆ 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 703 of file TableGenServer.cpp.

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

◆ 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 693 of file TableGenServer.cpp.

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

◆ 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 678 of file TableGenServer.cpp.

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


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