|
hoshi-lang dev
Yet another programming language
|
#include <document.h>

Public Member Functions | |
| void | setProjectIndex (ProjectIndex *index) |
| ProjectIndex * | getProjectIndex () |
| void | setCompilerContext (std::shared_ptr< yoi::compilerContext > ctx) |
| void | openDocument (const std::string &uri, const std::string &text, const std::string &languageId, int version) |
| void | updateDocument (const std::string &uri, const std::string &text, int version) |
| void | closeDocument (const std::string &uri) |
| Document * | getDocument (const std::string &uri) |
| void | reparseDocument (const std::string &uri) |
| const std::map< std::string, Document > & | getDocuments () const |
Private Member Functions | |
| void | resolveAndIndexImports (const std::string &uri, Document &doc) |
| Resolve import/use references in the document AST and index referenced modules. | |
Private Attributes | |
| std::map< std::string, Document > | documents |
| ProjectIndex * | projectIndex = nullptr |
| std::shared_ptr< yoi::compilerContext > | compilerCtx |
Definition at line 40 of file document.h.
| void closeDocument | ( | const std::string & | uri | ) |
Definition at line 47 of file document.cpp.
References DocumentStore::documents.
Referenced by LspServer::handleDidClose().

| Document * getDocument | ( | const std::string & | uri | ) |
Definition at line 51 of file document.cpp.
References DocumentStore::documents.
Referenced by LspServer::handleCompletion(), LspServer::handleDefinition(), LspServer::handleDocumentSymbol(), LspServer::handleHover(), and LspServer::publishDiagnostics().

|
inline |
Definition at line 54 of file document.h.
References DocumentStore::documents.
|
inline |
Definition at line 43 of file document.h.
References DocumentStore::projectIndex.
| void openDocument | ( | const std::string & | uri, |
| const std::string & | text, | ||
| const std::string & | languageId, | ||
| int | version | ||
| ) |
Definition at line 25 of file document.cpp.
References DocumentStore::documents, Document::languageId, Document::projectIndex, DocumentStore::projectIndex, DocumentStore::reparseDocument(), yoi::string2wstring(), Document::text, Document::uri, and Document::version.
Referenced by LspServer::handleDidOpen().


| void reparseDocument | ( | const std::string & | uri | ) |
Definition at line 57 of file document.cpp.
References yoi::__current_file_path, Document::ast, DiagnosticEngine::clear(), DiagnosticEngine::Collect, Document::compilerCtx, DocumentStore::compilerCtx, Document::crossModuleSymbols, Document::diagnostics, DocumentStore::documents, SymbolExtractor::extract(), yoi::finalizeAST(), DiagnosticEngine::getDiagnostics(), Document::irModule, yoi::parse(), Document::parseSucceeded, DocumentStore::resolveAndIndexImports(), lexer::scan(), yoi::set_current_file_path(), yoi::set_diagnostic_engine(), DiagnosticEngine::setCurrentFilePath(), yoi::string2wstring(), Document::symbols, Document::text, and visitor::visit().
Referenced by DocumentStore::openDocument(), and DocumentStore::updateDocument().


|
private |
Resolve import/use references in the document AST and index referenced modules.
Definition at line 160 of file document.cpp.
References Document::ast, Document::crossModuleSymbols, globalStmt::importDecl, ProjectIndex::indexAndGet(), Symbol::parentName, DocumentStore::projectIndex, ProjectIndex::resolveModule(), Symbol::sourceFile, hoshiModule::stmts, yoi::string2wstring(), globalStmt::useStmt, and yoi::wstring2string().
Referenced by DocumentStore::reparseDocument().


|
inline |
Definition at line 44 of file document.h.
References DocumentStore::compilerCtx.
Referenced by LspServer::LspServer().

|
inline |
Definition at line 42 of file document.h.
References DocumentStore::projectIndex.
Referenced by LspServer::LspServer().

| void updateDocument | ( | const std::string & | uri, |
| const std::string & | text, | ||
| int | version | ||
| ) |
Definition at line 37 of file document.cpp.
References DocumentStore::documents, DocumentStore::projectIndex, DocumentStore::reparseDocument(), and yoi::string2wstring().
Referenced by LspServer::handleDidChange().


|
private |
Definition at line 59 of file document.h.
Referenced by DocumentStore::reparseDocument(), and DocumentStore::setCompilerContext().
|
private |
Definition at line 57 of file document.h.
Referenced by DocumentStore::closeDocument(), DocumentStore::getDocument(), DocumentStore::getDocuments(), DocumentStore::openDocument(), DocumentStore::reparseDocument(), and DocumentStore::updateDocument().
|
private |
Definition at line 58 of file document.h.
Referenced by DocumentStore::getProjectIndex(), DocumentStore::openDocument(), DocumentStore::resolveAndIndexImports(), DocumentStore::setProjectIndex(), and DocumentStore::updateDocument().