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

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

Constructor & Destructor Documentation

◆ TableGenServer()

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

Definition at line 452 of file TableGenServer.cpp.

References ~TableGenServer().

◆ ~TableGenServer()

lsp::TableGenServer::~TableGenServer ( )
default

Referenced by TableGenServer().

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

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

◆ findHover()

Optional< lsp::Hover > lsp::TableGenServer::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 515 of file TableGenServer.cpp.

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

◆ 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 500 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 508 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 492 of file TableGenServer.cpp.

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

◆ removeDocument()

Optional< int64_t > lsp::TableGenServer::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 482 of file TableGenServer.cpp.

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

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

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


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