|
CIRCT 22.0.0git
|
#include <VerilogDocument.h>

Public Member Functions | |
| VerilogDocument (VerilogServerContext &globalContext, const llvm::lsp::URIForFile &uri, llvm::StringRef contents, std::vector< llvm::lsp::Diagnostic > &diagnostics, const slang::driver::Driver *projectDriver=nullptr, const std::vector< std::string > &projectIncludeDirectories={}) | |
| VerilogDocument (const VerilogDocument &)=delete | |
| VerilogDocument & | operator= (const VerilogDocument &)=delete |
| const llvm::lsp::URIForFile & | getURI () const |
| const slang::SourceManager & | getSlangSourceManager () const |
| llvm::lsp::Location | getLspLocation (slang::SourceLocation loc) const |
| llvm::lsp::Location | getLspLocation (slang::SourceRange range) const |
| slang::BufferID | getMainBufferID () const |
| void | getLocationsOf (const llvm::lsp::URIForFile &uri, const llvm::lsp::Position &defPos, std::vector< llvm::lsp::Location > &locations) |
| void | findReferencesOf (const llvm::lsp::URIForFile &uri, const llvm::lsp::Position &pos, std::vector< llvm::lsp::Location > &references) |
| std::optional< uint32_t > | lspPositionToOffset (const llvm::lsp::Position &pos) |
| const char * | getPointerFor (const llvm::lsp::Position &pos) |
Private Member Functions | |
| std::optional< std::pair< slang::BufferID, llvm::SmallString< 128 > > > | getOrOpenFile (llvm::StringRef filePath) |
| void | computeLineOffsets (std::string_view text) |
| Build a vector of line start offsets (0-based). | |
Private Attributes | |
| VerilogServerContext & | globalContext |
| slang::BufferID | mainBufferId |
| llvm::StringMap< std::pair< slang::BufferID, llvm::SmallString< 128 > > > | filePathMap |
| llvm::FailureOr< std::unique_ptr< slang::ast::Compilation > > | compilation |
| slang::driver::Driver | driver |
| std::unique_ptr< circt::lsp::VerilogIndex > | index |
| The index of the parsed module. | |
| std::vector< uint32_t > | lineOffsets |
| The precomputed line offsets for faster lookups. | |
| llvm::lsp::URIForFile | uri |
Definition at line 38 of file VerilogDocument.h.
| circt::lsp::VerilogDocument::VerilogDocument | ( | VerilogServerContext & | globalContext, |
| const llvm::lsp::URIForFile & | uri, | ||
| llvm::StringRef | contents, | ||
| std::vector< llvm::lsp::Diagnostic > & | diagnostics, | ||
| const slang::driver::Driver * | projectDriver = nullptr, |
||
| const std::vector< std::string > & | projectIncludeDirectories = {} |
||
| ) |
|
delete |
|
private |
Build a vector of line start offsets (0-based).
Definition at line 297 of file VerilogDocument.cpp.
References lineOffsets.
| void VerilogDocument::findReferencesOf | ( | const llvm::lsp::URIForFile & | uri, |
| const llvm::lsp::Position & | pos, | ||
| std::vector< llvm::lsp::Location > & | references | ||
| ) |
Definition at line 405 of file VerilogDocument.cpp.
References getLspLocation(), getPointerFor(), and index.
| void VerilogDocument::getLocationsOf | ( | const llvm::lsp::URIForFile & | uri, |
| const llvm::lsp::Position & | defPos, | ||
| std::vector< llvm::lsp::Location > & | locations | ||
| ) |
Definition at line 358 of file VerilogDocument.cpp.
References circt::lsp::Logger::error(), getLspLocation(), getOrOpenFile(), getPointerFor(), getRange(), index, and uri.
| llvm::lsp::Location VerilogDocument::getLspLocation | ( | slang::SourceLocation | loc | ) | const |
Definition at line 202 of file VerilogDocument.cpp.
References getSlangSourceManager(), mainBufferId, and uri.
Referenced by findReferencesOf(), getLocationsOf(), getLspLocation(), and circt::lsp::LSPDiagnosticClient::report().
| llvm::lsp::Location VerilogDocument::getLspLocation | ( | slang::SourceRange | range | ) | const |
Definition at line 235 of file VerilogDocument.cpp.
References getLspLocation().
|
inline |
Definition at line 58 of file VerilogDocument.h.
References mainBufferId.
|
private |
Definition at line 248 of file VerilogDocument.cpp.
References driver, circt::lsp::VerilogServerOptions::extraSourceLocationDirs, filePathMap, globalContext, and circt::lsp::VerilogServerContext::options.
Referenced by getLocationsOf().
| const char * VerilogDocument::getPointerFor | ( | const llvm::lsp::Position & | pos | ) |
Definition at line 347 of file VerilogDocument.cpp.
References getSlangSourceManager(), lspPositionToOffset(), and mainBufferId.
Referenced by findReferencesOf(), and getLocationsOf().
|
inline |
Definition at line 50 of file VerilogDocument.h.
References driver.
Referenced by getLspLocation(), getPointerFor(), and lspPositionToOffset().
|
inline |
Definition at line 48 of file VerilogDocument.h.
References uri.
Referenced by circt::lsp::LSPDiagnosticClient::report().
| std::optional< uint32_t > VerilogDocument::lspPositionToOffset | ( | const llvm::lsp::Position & | pos | ) |
Definition at line 310 of file VerilogDocument.cpp.
References getSlangSourceManager(), lineOffsets, and mainBufferId.
Referenced by getPointerFor().
|
delete |
|
private |
Definition at line 89 of file VerilogDocument.h.
|
private |
Definition at line 92 of file VerilogDocument.h.
Referenced by getOrOpenFile(), and getSlangSourceManager().
|
private |
Definition at line 86 of file VerilogDocument.h.
Referenced by getOrOpenFile().
|
private |
Definition at line 79 of file VerilogDocument.h.
Referenced by getOrOpenFile().
|
private |
The index of the parsed module.
Definition at line 95 of file VerilogDocument.h.
Referenced by findReferencesOf(), and getLocationsOf().
|
private |
The precomputed line offsets for faster lookups.
Definition at line 98 of file VerilogDocument.h.
Referenced by computeLineOffsets(), and lspPositionToOffset().
|
private |
Definition at line 81 of file VerilogDocument.h.
Referenced by getLspLocation(), getMainBufferID(), getPointerFor(), and lspPositionToOffset().
|
private |
Definition at line 102 of file VerilogDocument.h.
Referenced by getLocationsOf(), getLspLocation(), and getURI().