MLIR
20.0.0git
|
#include "TableGenServer.h"
#include "mlir/Support/IndentedOstream.h"
#include "mlir/Tools/lsp-server-support/CompilationDatabase.h"
#include "mlir/Tools/lsp-server-support/Logging.h"
#include "mlir/Tools/lsp-server-support/Protocol.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/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 lsp::URIForFile | getURIFromLoc (const SourceMgr &mgr, SMLoc loc, const lsp::URIForFile &mainFileURI) |
Returns a language server uri for the given source location. More... | |
static lsp::Location | getLocationFromLoc (SourceMgr &mgr, SMRange loc, const lsp::URIForFile &uri) |
Returns a language server location from the given source range. More... | |
static lsp::Location | getLocationFromLoc (SourceMgr &mgr, SMLoc loc, const lsp::URIForFile &uri) |
static std::optional< lsp::Diagnostic > | getLspDiagnoticFromDiag (const llvm::SMDiagnostic &diag, const 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 108 of file TableGenServer.cpp.
|
static |
Definition at line 59 of file TableGenServer.cpp.
References convertTokenLocToRange(), and getLocationFromLoc().
|
static |
Returns a language server location from the given source range.
Definition at line 54 of file TableGenServer.cpp.
References getURIFromLoc().
Referenced by getLocationFromLoc(), and getLspDiagnoticFromDiag().
|
static |
Convert the given TableGen diagnostic to the LSP form.
Definition at line 66 of file TableGenServer.cpp.
References mlir::lsp::Diagnostic::category, diag(), mlir::lsp::Error, getLocationFromLoc(), mlir::lsp::Information, mlir::lsp::Diagnostic::message, mlir::lsp::Location::range, mlir::lsp::Diagnostic::range, mlir::lsp::Diagnostic::severity, mlir::lsp::Diagnostic::source, mlir::lsp::Location::uri, and mlir::lsp::Warning.
|
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 39 of file TableGenServer.cpp.
References mlir::lsp::Logger::error(), mlir::lsp::URIForFile::fromFile(), and toString().
Referenced by getLocationFromLoc().