MLIR
22.0.0git
|
#include "TableGenServer.h"
#include "mlir/Support/IndentedOstream.h"
#include "mlir/Tools/lsp-server-support/CompilationDatabase.h"
#include "mlir/Tools/lsp-server-support/SourceMgrUtils.h"
#include "llvm/ADT/IntervalMap.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/LSP/Logging.h"
#include "llvm/Support/LSP/Protocol.h"
#include "llvm/Support/Path.h"
#include "llvm/TableGen/Parser.h"
#include "llvm/TableGen/Record.h"
#include <optional>
Go to the source code of this file.
Classes | |
struct | mlir::lsp::TableGenServer::Impl |
Functions | |
static SMRange | convertTokenLocToRange (SMLoc loc) |
Returns the range of a lexical token given a SMLoc corresponding to the start of an token location. More... | |
static llvm::lsp::URIForFile | getURIFromLoc (const SourceMgr &mgr, SMLoc loc, const llvm::lsp::URIForFile &mainFileURI) |
Returns a language server uri for the given source location. More... | |
static llvm::lsp::Location | getLocationFromLoc (SourceMgr &mgr, SMRange loc, const llvm::lsp::URIForFile &uri) |
Returns a language server location from the given source range. More... | |
static llvm::lsp::Location | getLocationFromLoc (SourceMgr &mgr, SMLoc loc, const llvm::lsp::URIForFile &uri) |
static std::optional< llvm::lsp::Diagnostic > | getLspDiagnoticFromDiag (const llvm::SMDiagnostic &diag, const llvm::lsp::URIForFile &uri) |
Convert the given TableGen diagnostic to the LSP form. More... | |
static std::pair< const Record *, const RecordVal * > | getBaseValue (const Record *record, const RecordVal *value) |
Get the base definition of the given record value, or nullptr if one couldn't be found. More... | |
|
static |
Returns the range of a lexical token given a SMLoc corresponding to the start of an token location.
The range is computed heuristically, and supports identifier-like tokens, strings, etc.
Definition at line 33 of file TableGenServer.cpp.
References mlir::lsp::convertTokenLocToRange().
Referenced by getLocationFromLoc().
|
static |
Get the base definition of the given record value, or nullptr if one couldn't be found.
Definition at line 112 of file TableGenServer.cpp.
|
static |
Definition at line 63 of file TableGenServer.cpp.
References convertTokenLocToRange(), and getLocationFromLoc().
|
static |
Returns a language server location from the given source range.
Definition at line 57 of file TableGenServer.cpp.
References getURIFromLoc().
Referenced by getLocationFromLoc(), and getLspDiagnoticFromDiag().
|
static |
Convert the given TableGen diagnostic to the LSP form.
Definition at line 70 of file TableGenServer.cpp.
References diag(), Error, and getLocationFromLoc().
|
static |
Returns a language server uri for the given source location.
mainFileURI
corresponds to the uri for the main file of the source manager.
Definition at line 40 of file TableGenServer.cpp.
References toString().
Referenced by getLocationFromLoc().