42 const llvm::lsp::URIForFile &uri,
43 llvm::StringRef fileContents, int64_t
version,
44 std::vector<llvm::lsp::Diagnostic> &diagnostics);
54 update(
const llvm::lsp::URIForFile &uri, int64_t newVersion,
55 llvm::ArrayRef<llvm::lsp::TextDocumentContentChangeEvent> changes,
56 std::vector<llvm::lsp::Diagnostic> &diagnostics);
61 llvm::lsp::Position defPos,
62 std::vector<llvm::lsp::Location> &locations);
67 llvm::lsp::Position pos,
68 std::vector<llvm::lsp::Location> &references);
76 void setDocument(std::shared_ptr<VerilogDocument> newDoc);
82 void initialize(
const llvm::lsp::URIForFile &uri, int64_t newVersion,
83 std::vector<llvm::lsp::Diagnostic> &diagnostics);
104 std::shared_ptr<circt::lsp::VerilogDocument>
document;
This class represents a text file containing one or more Verilog documents.
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.
int64_t getVersion() const
Return the current version of this text file.
std::unique_ptr< slang::driver::Driver > projectDriver
The project-scale driver.
std::shared_ptr< VerilogDocument > getDocument()
Return document for read access.
VerilogServerContext & context
void getLocationsOf(const llvm::lsp::URIForFile &uri, llvm::lsp::Position defPos, std::vector< llvm::lsp::Location > &locations)
Return position of definition of an object pointed to by pos.
void findReferencesOf(const llvm::lsp::URIForFile &uri, llvm::lsp::Position pos, std::vector< llvm::lsp::Location > &references)
Return all references to an object pointed to by pos.
std::string contents
The full string contents of the file.
int64_t version
The version of this 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.
std::shared_mutex contentMutex
A mutex to control updates of contents.
void initializeProjectDriver()
std::shared_mutex docMutex
A mutex to control updates of document; Acquire AFTER contentMutex.
std::vector< std::string > projectIncludeDirectories
std::shared_ptr< circt::lsp::VerilogDocument > document
The chunks of this file.
void setDocument(std::shared_ptr< VerilogDocument > newDoc)
Override document after update.