9 #ifndef LIB_MLIR_TOOLS_MLIRPDLLSPSERVER_SERVER_H_
10 #define LIB_MLIR_TOOLS_MLIRPDLLSPSERVER_SERVER_H_
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/LSP/Protocol.h"
22 using llvm::lsp::CompletionList;
23 using llvm::lsp::Diagnostic;
24 using llvm::lsp::DocumentLink;
25 using llvm::lsp::DocumentSymbol;
26 using llvm::lsp::Hover;
27 using llvm::lsp::InlayHint;
28 using llvm::lsp::Location;
29 using llvm::lsp::Position;
30 using llvm::lsp::Range;
31 using llvm::lsp::SignatureHelp;
32 using llvm::lsp::TextDocumentContentChangeEvent;
33 using llvm::lsp::URIForFile;
35 class CompilationDatabase;
36 struct PDLLViewOutputResult;
46 const std::vector<std::string> &
extraDirs)
62 void addDocument(
const URIForFile &uri, StringRef contents, int64_t version,
63 std::vector<Diagnostic> &diagnostics);
69 int64_t version, std::vector<Diagnostic> &diagnostics);
78 std::vector<Location> &locations);
82 std::vector<Location> &references);
86 std::vector<DocumentLink> &documentLinks);
90 std::optional<Hover>
findHover(
const URIForFile &uri,
91 const Position &hoverPos);
95 std::vector<DocumentSymbol> &symbols);
99 const Position &completePos);
103 const Position &helpPos);
106 void getInlayHints(
const URIForFile &uri,
const Range &range,
107 std::vector<InlayHint> &inlayHints);
111 std::optional<PDLLViewOutputResult>
116 std::unique_ptr<Impl>
impl;
union mlir::linalg::@1252::ArityGroupAndKind::Kind kind
static llvm::ManagedStatic< PassManagerOptions > options
This class implements all of the PDLL related functionality necessary for a language server.
void getLocationsOf(const URIForFile &uri, const Position &defPos, std::vector< Location > &locations)
Return the locations of the object pointed at by the given position.
void getDocumentLinks(const URIForFile &uri, std::vector< DocumentLink > &documentLinks)
Return the document links referenced by the given file.
void getInlayHints(const URIForFile &uri, const Range &range, std::vector< InlayHint > &inlayHints)
Get the inlay hints for the range within 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.
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 findReferencesOf(const URIForFile &uri, const Position &pos, std::vector< Location > &references)
Find all references of the object pointed at by the given position.
void findDocumentSymbols(const URIForFile &uri, std::vector< DocumentSymbol > &symbols)
Find all of the document symbols within the given file.
std::optional< int64_t > removeDocument(const URIForFile &uri)
Remove the document with the given uri.
CompletionList getCodeCompletion(const URIForFile &uri, const Position &completePos)
Get the code completion list for the position within the given file.
SignatureHelp getSignatureHelp(const URIForFile &uri, const Position &helpPos)
Get the signature help for the position within the given file.
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.
PDLLServer(const Options &options)
std::optional< PDLLViewOutputResult > getPDLLViewOutput(const URIForFile &uri, PDLLViewOutputKind kind)
Get the output of the given PDLL file, or std::nullopt if there is no valid output.
PDLLViewOutputKind
The type of output to view from PDLL.
Include the generated interface declarations.
const std::vector< std::string > & extraDirs
Additional list of include directories to search.
Options(const std::vector< std::string > &compilationDatabases, const std::vector< std::string > &extraDirs)
const std::vector< std::string > & compilationDatabases
The filenames for databases containing compilation commands for PDLL files passed to the server.