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

Public Member Functions | |
| LspServer () | |
| ~LspServer () | |
| void | run () |
Private Member Functions | |
| std::string | readMessage () |
| void | writeMessage (const std::string &content) |
| void | handleMessage (const json &msg) |
| void | sendResponse (const json &id, const json &result) |
| void | sendError (const json &id, int code, const std::string &message) |
| void | sendNotification (const std::string &method, const json ¶ms) |
| void | handleInitialize (const json &id, const json ¶ms) |
| void | handleInitialized (const json ¶ms) |
| void | handleShutdown (const json &id) |
| void | handleExit () |
| void | handleDidOpen (const json ¶ms) |
| void | handleDidChange (const json ¶ms) |
| void | handleDidClose (const json ¶ms) |
| void | handleCompletion (const json &id, const json ¶ms) |
| void | handleHover (const json &id, const json ¶ms) |
| void | handleDefinition (const json &id, const json ¶ms) |
| void | handleReferences (const json &id, const json ¶ms) |
| void | handleDocumentSymbol (const json &id, const json ¶ms) |
| void | publishDiagnostics (const std::string &uri, int version) |
Private Attributes | |
| DocumentStore | documents |
| ProjectIndex | projectIndex |
| std::shared_ptr< yoi::compilerContext > | compilerCtx |
| std::string | workspaceRoot |
| bool | isInitialized = false |
| bool | compilerInitialized = false |
| bool | isShuttingDown = false |
| LspServer | ( | ) |
Definition at line 17 of file server.cpp.
References LspServer::compilerCtx, IRBuildConfig::debug, LspServer::documents, IRBuildConfig::executable, HOSHI_LANG_GIT_COMMIT_HASH, HOSHI_LANG_VERSION, LspServer::projectIndex, IRBuildConfig::Builder::setBuildArch(), IRBuildConfig::Builder::setBuildMode(), IRBuildConfig::Builder::setBuildPlatform(), IRBuildConfig::Builder::setBuildType(), DocumentStore::setCompilerContext(), DocumentStore::setProjectIndex(), IRBuildConfig::Builder::setSearchPaths(), yoi::string2wstring(), yoi::whereIsHoshiLang(), IRBuildConfig::Builder::yield(), YOI_ARCH, and YOI_PLATFORM.

|
default |
Definition at line 295 of file server.cpp.
References LspServer::documents, DocumentStore::getDocument(), CompletionParams::position, CompletionProvider::provide(), LspServer::sendResponse(), CompletionParams::textDocument, and TextDocumentIdentifier::uri.
Referenced by LspServer::handleMessage().


Definition at line 319 of file server.cpp.
References LspServer::documents, DocumentStore::getDocument(), DefinitionParams::position, DefinitionProvider::provide(), LspServer::sendResponse(), DefinitionParams::textDocument, and TextDocumentIdentifier::uri.
Referenced by LspServer::handleMessage().


|
private |
Definition at line 228 of file server.cpp.
References DidChangeTextDocumentParams::contentChanges, LspServer::documents, LspServer::publishDiagnostics(), DidChangeTextDocumentParams::textDocument, DocumentStore::updateDocument(), VersionedTextDocumentIdentifier::uri, and VersionedTextDocumentIdentifier::version.
Referenced by LspServer::handleMessage().


|
private |
Definition at line 238 of file server.cpp.
References DocumentStore::closeDocument(), LspServer::documents, LspServer::sendNotification(), DidCloseTextDocumentParams::textDocument, TextDocumentIdentifier::uri, and PublishDiagnosticsParams::uri.
Referenced by LspServer::handleMessage().


|
private |
Definition at line 221 of file server.cpp.
References LspServer::documents, TextDocumentItem::languageId, DocumentStore::openDocument(), LspServer::publishDiagnostics(), TextDocumentItem::text, DidOpenTextDocumentParams::textDocument, TextDocumentItem::uri, and TextDocumentItem::version.
Referenced by LspServer::handleMessage().


Definition at line 405 of file server.cpp.
References DocumentSymbol::children, LspServer::documents, lsp::documentSymbolFor(), lsp::extendRangeToInclude(), DocumentStore::getDocument(), DocumentSymbol::range, DocumentSymbol::selectionRange, and LspServer::sendResponse().
Referenced by LspServer::handleMessage().


|
private |
Definition at line 210 of file server.cpp.
References LspServer::isShuttingDown.
Referenced by LspServer::handleMessage().

Definition at line 305 of file server.cpp.
References LspServer::documents, DocumentStore::getDocument(), HoverParams::position, HoverProvider::provide(), LspServer::sendResponse(), HoverParams::textDocument, and TextDocumentIdentifier::uri.
Referenced by LspServer::handleMessage().


Definition at line 152 of file server.cpp.
References ProjectIndex::addSearchPath(), LspServer::projectIndex, LspServer::sendResponse(), yoi::whereIsHoshiLang(), LspServer::workspaceRoot, and yoi::wstring2string().
Referenced by LspServer::handleMessage().


|
private |
Definition at line 193 of file server.cpp.
References LspServer::compilerCtx, LspServer::compilerInitialized, and LspServer::isInitialized.
Referenced by LspServer::handleMessage().

|
private |
Definition at line 110 of file server.cpp.
References LspServer::handleCompletion(), LspServer::handleDefinition(), LspServer::handleDidChange(), LspServer::handleDidClose(), LspServer::handleDidOpen(), LspServer::handleDocumentSymbol(), LspServer::handleExit(), LspServer::handleHover(), LspServer::handleInitialize(), LspServer::handleInitialized(), LspServer::handleReferences(), LspServer::handleShutdown(), basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass >::object(), and LspServer::sendError().
Referenced by LspServer::run().


Definition at line 335 of file server.cpp.
References basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass >::array, and LspServer::sendResponse().
Referenced by LspServer::handleMessage().


|
private |
Definition at line 205 of file server.cpp.
References LspServer::isShuttingDown, and LspServer::sendResponse().
Referenced by LspServer::handleMessage().


|
private |
Definition at line 252 of file server.cpp.
References Position::character, Document::diagnostics, PublishDiagnosticsParams::diagnostics, LspServer::documents, Range::end, yoi::Error, lsp::Error, DocumentStore::getDocument(), yoi::Hint, lsp::Hint, lsp::Information, Position::line, LspDiagnostic::message, yoi::Note, LspDiagnostic::range, LspServer::sendNotification(), LspDiagnostic::severity, LspDiagnostic::source, Range::start, PublishDiagnosticsParams::uri, PublishDiagnosticsParams::version, yoi::Warning, and lsp::Warning.
Referenced by LspServer::handleDidChange(), and LspServer::handleDidOpen().


|
private |
Definition at line 44 of file server.cpp.
Referenced by LspServer::run().

| void run | ( | ) |
Definition at line 449 of file server.cpp.
References LspServer::handleMessage(), LspServer::isShuttingDown, and LspServer::readMessage().
Referenced by main().


|
private |
Definition at line 88 of file server.cpp.
References LspServer::writeMessage().
Referenced by LspServer::handleMessage().


|
private |
Definition at line 97 of file server.cpp.
References LspServer::writeMessage().
Referenced by LspServer::handleDidClose(), and LspServer::publishDiagnostics().


Definition at line 79 of file server.cpp.
References LspServer::writeMessage().
Referenced by LspServer::handleCompletion(), LspServer::handleDefinition(), LspServer::handleDocumentSymbol(), LspServer::handleHover(), LspServer::handleInitialize(), LspServer::handleReferences(), and LspServer::handleShutdown().


|
private |
Definition at line 73 of file server.cpp.
Referenced by LspServer::sendError(), LspServer::sendNotification(), and LspServer::sendResponse().

|
private |
Definition at line 57 of file server.h.
Referenced by LspServer::handleInitialized(), and LspServer::LspServer().
|
private |
Definition at line 60 of file server.h.
Referenced by LspServer::handleInitialized().
|
private |
Definition at line 55 of file server.h.
Referenced by LspServer::handleCompletion(), LspServer::handleDefinition(), LspServer::handleDidChange(), LspServer::handleDidClose(), LspServer::handleDidOpen(), LspServer::handleDocumentSymbol(), LspServer::handleHover(), LspServer::LspServer(), and LspServer::publishDiagnostics().
|
private |
Definition at line 59 of file server.h.
Referenced by LspServer::handleInitialized().
|
private |
Definition at line 61 of file server.h.
Referenced by LspServer::handleExit(), LspServer::handleShutdown(), and LspServer::run().
|
private |
Definition at line 56 of file server.h.
Referenced by LspServer::handleInitialize(), and LspServer::LspServer().
|
private |
Definition at line 58 of file server.h.
Referenced by LspServer::handleInitialize().