CIRCT 22.0.0git
|
This class represents a text file containing one or more Verilog documents. More...
#include <VerilogTextFile.h>
Public Member Functions | |
VerilogTextFile (VerilogServerContext &globalContext, const llvm::lsp::URIForFile &uri, llvm::StringRef fileContents, int64_t version, std::vector< llvm::lsp::Diagnostic > &diagnostics) | |
int64_t | getVersion () const |
Return the current version of this text file. | |
llvm::LogicalResult | update (const llvm::lsp::URIForFile &uri, int64_t newVersion, llvm::ArrayRef< llvm::lsp::TextDocumentContentChangeEvent > changes, std::vector< llvm::lsp::Diagnostic > &diagnostics) |
Update the file to the new version using the provided set of content changes. | |
void | getLocationsOf (const llvm::lsp::URIForFile &uri, llvm::lsp::Position defPos, std::vector< llvm::lsp::Location > &locations) |
void | findReferencesOf (const llvm::lsp::URIForFile &uri, llvm::lsp::Position pos, std::vector< llvm::lsp::Location > &references) |
Private Member Functions | |
void | initialize (const llvm::lsp::URIForFile &uri, int64_t newVersion, std::vector< llvm::lsp::Diagnostic > &diagnostics) |
Initialize the text file from the given file contents. | |
Private Attributes | |
VerilogServerContext & | context |
std::string | contents |
The full string contents of the file. | |
int64_t | version = 0 |
The version of this file. | |
std::unique_ptr< circt::lsp::VerilogDocument > | document |
The chunks of this file. | |
This class represents a text file containing one or more Verilog documents.
Definition at line 37 of file VerilogTextFile.h.
VerilogTextFile::VerilogTextFile | ( | VerilogServerContext & | globalContext, |
const llvm::lsp::URIForFile & | uri, | ||
llvm::StringRef | fileContents, | ||
int64_t | version, | ||
std::vector< llvm::lsp::Diagnostic > & | diagnostics | ||
) |
Definition at line 37 of file VerilogTextFile.cpp.
References initialize(), and version.
void VerilogTextFile::findReferencesOf | ( | const llvm::lsp::URIForFile & | uri, |
llvm::lsp::Position | pos, | ||
std::vector< llvm::lsp::Location > & | references | ||
) |
Definition at line 75 of file VerilogTextFile.cpp.
References document.
void VerilogTextFile::getLocationsOf | ( | const llvm::lsp::URIForFile & | uri, |
llvm::lsp::Position | defPos, | ||
std::vector< llvm::lsp::Location > & | locations | ||
) |
Definition at line 69 of file VerilogTextFile.cpp.
References document.
|
inline |
Return the current version of this text file.
Definition at line 45 of file VerilogTextFile.h.
References version.
|
private |
Initialize the text file from the given file contents.
Definition at line 61 of file VerilogTextFile.cpp.
References contents, context, document, and version.
Referenced by update(), and VerilogTextFile().
LogicalResult VerilogTextFile::update | ( | const llvm::lsp::URIForFile & | uri, |
int64_t | newVersion, | ||
llvm::ArrayRef< llvm::lsp::TextDocumentContentChangeEvent > | changes, | ||
std::vector< llvm::lsp::Diagnostic > & | diagnostics | ||
) |
Update the file to the new version using the provided set of content changes.
Returns failure if the update was unsuccessful.
Definition at line 45 of file VerilogTextFile.cpp.
References contents, circt::lsp::Logger::error(), and initialize().
|
private |
The full string contents of the file.
Definition at line 70 of file VerilogTextFile.h.
Referenced by initialize(), and update().
|
private |
Definition at line 67 of file VerilogTextFile.h.
Referenced by initialize().
|
private |
The chunks of this file.
The order of these chunks is the order in which they appear in the text file.
Definition at line 77 of file VerilogTextFile.h.
Referenced by findReferencesOf(), getLocationsOf(), and initialize().
|
private |
The version of this file.
Definition at line 73 of file VerilogTextFile.h.
Referenced by getVersion(), initialize(), and VerilogTextFile().