9 #ifndef LIB_MLIR_TOOLS_TBLGENLSPSERVER_TABLEGENSERVER_H_
10 #define LIB_MLIR_TOOLS_TBLGENLSPSERVER_TABLEGENSERVER_H_
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/LSP/Protocol.h"
22 using llvm::lsp::Diagnostic;
23 using llvm::lsp::DocumentLink;
24 using llvm::lsp::Hover;
25 using llvm::lsp::Location;
26 using llvm::lsp::Position;
27 using llvm::lsp::TextDocumentContentChangeEvent;
28 using llvm::lsp::URIForFile;
37 const std::vector<std::string> &
extraDirs)
53 void addDocument(
const URIForFile &uri, StringRef contents, int64_t version,
54 std::vector<Diagnostic> &diagnostics);
60 int64_t version, std::vector<Diagnostic> &diagnostics);
69 std::vector<Location> &locations);
73 std::vector<Location> &references);
77 std::vector<DocumentLink> &documentLinks);
81 std::optional<Hover>
findHover(
const URIForFile &uri,
82 const Position &hoverPos);
86 std::unique_ptr<Impl>
impl;
static llvm::ManagedStatic< PassManagerOptions > options
This class implements all of the TableGen related functionality necessary for a language server.
std::optional< int64_t > removeDocument(const URIForFile &uri)
Remove the document with the given uri.
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.
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.
void getDocumentLinks(const URIForFile &uri, std::vector< DocumentLink > &documentLinks)
Return the document links referenced by the given file.
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.
void getLocationsOf(const URIForFile &uri, const Position &defPos, std::vector< Location > &locations)
Return the locations of the object pointed at by the given position.
TableGenServer(const Options &options)
void findReferencesOf(const URIForFile &uri, const Position &pos, std::vector< Location > &references)
Find all references of the object pointed at by the given position.
Include the generated interface declarations.
const std::vector< std::string > & compilationDatabases
The filenames for databases containing compilation commands for TableGen files passed to the server.
Options(const std::vector< std::string > &compilationDatabases, const std::vector< std::string > &extraDirs)
const std::vector< std::string > & extraDirs
Additional list of include directories to search.