9 #ifndef LIB_MLIR_TOOLS_MLIRLSPSERVER_SERVER_H_
10 #define LIB_MLIR_TOOLS_MLIRLSPSERVER_SERVER_H_
13 #include "llvm/Support/Error.h"
18 class DialectRegistry;
22 struct CodeActionContext;
23 struct CompletionList;
25 struct DocumentSymbol;
28 struct MLIRConvertBytecodeResult;
47 std::vector<Diagnostic> &diagnostics);
56 std::vector<Location> &locations);
60 std::vector<Location> &references);
69 std::vector<DocumentSymbol> &symbols);
78 std::vector<CodeAction> &actions);
91 std::unique_ptr<Impl>
impl;
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
This class implements all of the MLIR related functionality necessary for a language server.
void addOrUpdateDocument(const URIForFile &uri, StringRef contents, int64_t version, std::vector< Diagnostic > &diagnostics)
Add or update the document, with the provided version, at the given URI.
std::optional< int64_t > removeDocument(const URIForFile &uri)
Remove the document with the given uri.
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 getLocationsOf(const URIForFile &uri, const Position &defPos, std::vector< Location > &locations)
Return the locations of the object pointed at by the given position.
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.
llvm::Expected< MLIRConvertBytecodeResult > convertFromBytecode(const URIForFile &uri)
Convert the given bytecode file to the textual format.
llvm::Expected< MLIRConvertBytecodeResult > convertToBytecode(const URIForFile &uri)
Convert the given textual file to the bytecode format.
MLIRServer(DialectRegistry ®istry)
Construct a new server with the given dialect regitstry.
CompletionList getCodeCompletion(const URIForFile &uri, const Position &completePos)
Get the code completion list for the position within the given file.
void findDocumentSymbols(const URIForFile &uri, std::vector< DocumentSymbol > &symbols)
Find all of the document symbols within the given file.
void getCodeActions(const URIForFile &uri, const Range &pos, const CodeActionContext &context, std::vector< CodeAction > &actions)
Get the set of code actions within the file.
URI in "file" scheme for a file.
Include the generated interface declarations.
Represents a collection of completion items to be presented in the editor.