| 1 |
#ifndef __LanguageServerPlugin__ |
| 2 |
#define __LanguageServerPlugin__ |
| 3 |
|
| 4 |
#include "CompileCommandsGenerator.h" |
| 5 |
#include "LSPDetector.hpp" |
| 6 |
#include "LanguageServerCluster.h" |
| 7 |
#include "LanguageServerLogView.h" |
| 8 |
#include "clTabTogglerHelper.h" |
| 9 |
#include "cl_command_event.h" |
| 10 |
#include "plugin.h" |
| 11 |
|
| 12 |
class LanguageServerPlugin : public IPlugin |
| 13 |
{ |
| 14 |
LanguageServerCluster::Ptr_t m_servers; |
| 15 |
IProcess* m_process = nullptr; |
| 16 |
clTabTogglerHelper::Ptr_t m_tabToggler; |
| 17 |
LanguageServerLogView* m_logView = nullptr; |
| 18 |
|
| 19 |
protected: |
| 20 |
void OnSettings(wxCommandEvent& e); |
| 21 |
void OnRestartLSP(wxCommandEvent& e); |
| 22 |
void OnInitDone(wxCommandEvent& event); |
| 23 |
void OnEditorContextMenu(clContextMenuEvent& event); |
| 24 |
void OnMenuFindSymbol(wxCommandEvent& event); |
| 25 |
void OnMenuRenameSymbol(wxCommandEvent& event); |
| 26 |
void OnMenuFindReferences(wxCommandEvent& event); |
| 27 |
void ConfigureLSPs(const std::vector<LSPDetector::Ptr_t>& lsps); |
| 28 |
|
| 29 |
void OnLSPStopAll(clLanguageServerEvent& event); |
| 30 |
void OnLSPStartAll(clLanguageServerEvent& event); |
| 31 |
void OnLSPRestartAll(clLanguageServerEvent& event); |
| 32 |
void OnLSPStopOne(clLanguageServerEvent& event); |
| 33 |
void OnLSPStartOne(clLanguageServerEvent& event); |
| 34 |
void OnLSPRestartOne(clLanguageServerEvent& event); |
| 35 |
void OnLSPConfigure(clLanguageServerEvent& event); |
| 36 |
void OnLSPDelete(clLanguageServerEvent& event); |
| 37 |
void OnLSPShowSettingsDlg(clLanguageServerEvent& event); |
| 38 |
void OnLSPEnableServer(clLanguageServerEvent& event); |
| 39 |
void OnLSPDisableServer(clLanguageServerEvent& event); |
| 40 |
wxString GetEditorFilePath(IEditor* editor) const; |
| 41 |
void OnWorkspaceClosed(clWorkspaceEvent& event); |
| 42 |
|
| 43 |
public: |
| 44 |
LanguageServerPlugin(IManager* manager); |
| 45 |
virtual ~LanguageServerPlugin(); |
| 46 |
|
| 47 |
//-------------------------------------------- |
| 48 |
// Abstract methods |
| 49 |
//-------------------------------------------- |
| 50 |
virtual void CreateToolBar(clToolBarGeneric* toolbar); |
| 51 |
/** |
| 52 |
* @brief Add plugin menu to the "Plugins" menu item in the menu bar |
| 53 |
*/ |
| 54 |
virtual void CreatePluginMenu(wxMenu* pluginsMenu); |
| 55 |
|
| 56 |
/** |
| 57 |
* @brief Unplug the plugin. Perform here any cleanup needed (e.g. unbind events, destroy allocated windows) |
| 58 |
*/ |
| 59 |
virtual void UnPlug(); |
| 60 |
|
| 61 |
/** |
| 62 |
* @brief log message to the output tab |
| 63 |
*/ |
| 64 |
void LogMessage(const wxString& server_name, const wxString& message, int log_leve); |
| 65 |
}; |
| 66 |
|
| 67 |
#endif // LanguageServerPlugin |