Bash++
Bash++ compiler internal documentation
|
The main server class for handling LSP requests and notifications. More...
#include <BashppServer.h>
Public Member Functions | |
BashppServer () | |
~BashppServer () | |
void | mainLoop () |
void | setInputStream (std::shared_ptr< std::istream > stream) |
void | setOutputStream (std::shared_ptr< std::ostream > stream) |
void | setSocketPath (const std::string &path) |
void | setLogFile (const std::string &path) |
GenericResponseMessage | shutdown (const GenericRequestMessage &request) |
void | cleanup () |
void | processMessage (const std::string &message) |
GenericResponseMessage | handleInitialize (const GenericRequestMessage &request) |
GenericResponseMessage | handleDefinition (const GenericRequestMessage &request) |
GenericResponseMessage | handleHover (const GenericRequestMessage &request) |
GenericResponseMessage | handleDocumentSymbol (const GenericRequestMessage &request) |
GenericResponseMessage | handleRename (const GenericRequestMessage &request) |
GenericResponseMessage | handleReferences (const GenericRequestMessage &request) |
GenericResponseMessage | handleCompletion (const GenericRequestMessage &request) |
CompletionList | handleATCompletion (const CompletionParams ¶ms) |
CompletionList | handleDOTCompletion (const CompletionParams ¶ms) |
void | handleDidOpen (const GenericNotificationMessage &request) |
void | handleDidChange (const GenericNotificationMessage &request) |
void | handleDidChangeWatchedFiles (const GenericNotificationMessage &request) |
void | handleDidClose (const GenericNotificationMessage &request) |
void | sendResponse (const GenericResponseMessage &response) |
void | sendNotification (const GenericNotificationMessage ¬ification) |
void | publishDiagnostics (std::shared_ptr< bpp::bpp_program > program) |
void | add_include_path (const std::string &path) |
void | set_suppress_warnings (bool suppress) |
template<typename... Args> | |
void | log (Args &&... args) |
Private Types | |
using | RequestHandler = GenericResponseMessage(BashppServer::*)(const GenericRequestMessage &) |
using | NotificationHandler = void(BashppServer::*)(const GenericNotificationMessage &) |
Private Member Functions | |
void | _sendMessage (const std::string &message) |
void | processRequest (const GenericRequestMessage &request) |
void | processNotification (const GenericNotificationMessage ¬ification) |
Static Private Member Functions | |
static const GenericResponseMessage | invalidRequestHandler (const GenericRequestMessage &request) |
static void | invalidNotificationHandler (const GenericNotificationMessage &request) |
Private Attributes | |
pid_t | pid = getpid() |
std::shared_ptr< std::istream > | input_stream |
std::shared_ptr< std::ostream > | output_stream |
std::optional< std::string > | socket_path |
ThreadPool | thread_pool = ThreadPool(std::thread::hardware_concurrency()) |
ProgramPool | program_pool = ProgramPool(10) |
std::ofstream | log_file |
std::unordered_map< std::string, std::string > | unsaved_changes |
std::mutex | unsaved_changes_mutex |
std::atomic< bool > | stored_changes_content_updating = false |
std::unordered_map< std::string, std::shared_ptr< std::atomic< uint64_t > > > | debounce_timestamps |
std::mutex | debounce_mutex |
CompletionList | default_completion_list |
Static Private Attributes | |
static std::mutex | output_mutex |
static std::mutex | log_mutex |
static const frozen::unordered_map< frozen::string, RequestHandler, 8 > | request_handlers |
Maps request types to the functions that handle them. | |
static const frozen::unordered_map< frozen::string, NotificationHandler, 4 > | notification_handlers |
Maps notification types to the functions that handle them. | |
The main server class for handling LSP requests and notifications.
This class manages the server's lifecycle, handles incoming messages, processes requests and notifications, logs, and maintains the state of the server.
|
private |
|
private |
bpp::BashppServer::BashppServer | ( | ) |
bpp::BashppServer::~BashppServer | ( | ) |
|
private |
void bpp::BashppServer::add_include_path | ( | const std::string & | path | ) |
void bpp::BashppServer::cleanup | ( | ) |
CompletionList bpp::BashppServer::handleATCompletion | ( | const CompletionParams & | params | ) |
GenericResponseMessage bpp::BashppServer::handleCompletion | ( | const GenericRequestMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
GenericResponseMessage bpp::BashppServer::handleDefinition | ( | const GenericRequestMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
void bpp::BashppServer::handleDidChange | ( | const GenericNotificationMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
void bpp::BashppServer::handleDidChangeWatchedFiles | ( | const GenericNotificationMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
void bpp::BashppServer::handleDidClose | ( | const GenericNotificationMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
void bpp::BashppServer::handleDidOpen | ( | const GenericNotificationMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
GenericResponseMessage bpp::BashppServer::handleDocumentSymbol | ( | const GenericRequestMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
CompletionList bpp::BashppServer::handleDOTCompletion | ( | const CompletionParams & | params | ) |
GenericResponseMessage bpp::BashppServer::handleHover | ( | const GenericRequestMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
GenericResponseMessage bpp::BashppServer::handleInitialize | ( | const GenericRequestMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
GenericResponseMessage bpp::BashppServer::handleReferences | ( | const GenericRequestMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
GenericResponseMessage bpp::BashppServer::handleRename | ( | const GenericRequestMessage & | request | ) |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
|
staticprivate |
|
staticprivate |
|
inline |
void bpp::BashppServer::mainLoop | ( | ) |
void bpp::BashppServer::processMessage | ( | const std::string & | message | ) |
|
private |
|
private |
void bpp::BashppServer::publishDiagnostics | ( | std::shared_ptr< bpp::bpp_program > | program | ) |
void bpp::BashppServer::sendNotification | ( | const GenericNotificationMessage & | notification | ) |
void bpp::BashppServer::sendResponse | ( | const GenericResponseMessage & | response | ) |
void bpp::BashppServer::set_suppress_warnings | ( | bool | suppress | ) |
void bpp::BashppServer::setInputStream | ( | std::shared_ptr< std::istream > | stream | ) |
void bpp::BashppServer::setLogFile | ( | const std::string & | path | ) |
void bpp::BashppServer::setOutputStream | ( | std::shared_ptr< std::ostream > | stream | ) |
void bpp::BashppServer::setSocketPath | ( | const std::string & | path | ) |
GenericResponseMessage bpp::BashppServer::shutdown | ( | const GenericRequestMessage & | request | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
Maps notification types to the functions that handle them.
|
staticprivate |
Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes
|
private |
|
private |
|
private |
|
staticprivate |
Maps request types to the functions that handle them.
|
private |
|
private |
|
private |
|
private |
|
private |