diff --git a/CMakeLists.txt b/CMakeLists.txt index d38da85f03..70a59183da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1113,9 +1113,7 @@ else() # utility for importing themes add_subdirectory(codelite-generate-themes) - add_subdirectory(codelite_echo) - add_subdirectory(ctagsd) add_subdirectory(LiteEditor) if(NOT APPLE) @@ -1126,7 +1124,6 @@ else() add_dependencies(plugin libcodelite) add_dependencies(codelite plugin) add_dependencies(codelite ctags) - add_dependencies(codelite ctagsd) add_dependencies(codelite cc-wrapper) if(MINGW) add_dependencies(codelite wx-config) diff --git a/CodeLite/ctags_manager.cpp b/CodeLite/ctags_manager.cpp index e295ab13a3..02d83a7509 100644 --- a/CodeLite/ctags_manager.cpp +++ b/CodeLite/ctags_manager.cpp @@ -754,32 +754,3 @@ void TagsManager::GetTagsByPartialNames(const wxArrayString& partialNames, std:: { GetDatabase()->GetTagsByPartName(partialNames, tags); } - -void TagsManager::ParseWorkspaceIncremental() -{ - // restart ctagsd (this way we ensure that new settings are loaded) - clLanguageServerEvent stop_event{wxEVT_LSP_RESTART}; - stop_event.SetLspName("ctagsd"); - EventNotifier::Get()->AddPendingEvent(stop_event); -} - -void TagsManager::ParseWorkspaceFull(const wxString& workspace_dir) -{ - // stop ctagsd - clLanguageServerEvent stop_event{wxEVT_LSP_STOP}; - stop_event.SetLspName("ctagsd"); - EventNotifier::Get()->ProcessEvent(stop_event); - - // delete the tags.db file - wxFileName tags_db{workspace_dir, "tags.db"}; - tags_db.AppendDir(".ctagsd"); - - if (tags_db.FileExists()) { - FileUtils::RemoveFile(tags_db, wxEmptyString); - } - - // start ctagsd again - clLanguageServerEvent start_event{wxEVT_LSP_START}; - start_event.SetLspName("ctagsd"); - EventNotifier::Get()->ProcessEvent(start_event); -} diff --git a/CodeLite/ctags_manager.h b/CodeLite/ctags_manager.h index 37dd31206d..cb54231ff8 100644 --- a/CodeLite/ctags_manager.h +++ b/CodeLite/ctags_manager.h @@ -214,16 +214,6 @@ class WXDLLIMPEXP_CL TagsManager : public wxEvtHandler */ void CloseDatabase(); - /** - * @brief trigger a complete parsing of the workspace - */ - void ParseWorkspaceFull(const wxString& workspace_dir); - - /** - * @brief trigger an incremental workspace parsing - */ - void ParseWorkspaceIncremental(); - /** * return tags belongs to given scope and kind * @param scopeName the scope to search diff --git a/Gizmos/gizmos.cpp b/Gizmos/gizmos.cpp index 71ba2a23e8..d80ad16a62 100644 --- a/Gizmos/gizmos.cpp +++ b/Gizmos/gizmos.cpp @@ -553,9 +553,6 @@ void WizardsPlugin::CreateClass(NewClassInfo& info) clFileSystemEvent eventFilesCreated(wxEVT_FILE_CREATED); eventFilesCreated.GetPaths().swap(paths); EventNotifier::Get()->QueueEvent(eventFilesCreated.Clone()); - - // Notify CodeLite to parse the files - TagsManagerST::Get()->ParseWorkspaceIncremental(); } void WizardsPlugin::OnGizmos(wxCommandEvent& e) diff --git a/LiteEditor/CMakeLists.txt b/LiteEditor/CMakeLists.txt index fdb99f6d60..1c4b960a98 100644 --- a/LiteEditor/CMakeLists.txt +++ b/LiteEditor/CMakeLists.txt @@ -367,9 +367,6 @@ if(MINGW OR CYGWIN) write_file(${POST_INSTALL_SCRIPT} "file(GLOB FILES_TO_REMOVE \"${CL_INSTALL_BIN}/plugins/*.a\")") write_file(${POST_INSTALL_SCRIPT} "file(REMOVE \${FILES_TO_REMOVE})" APPEND) - # remove test executables from ctagsd - write_file(${POST_INSTALL_SCRIPT} "file(REMOVE \"${CL_INSTALL_BIN}/ctagsd-tests.exe\")" APPEND) - # remove libdapcxx.dll.a & libdatabaselayersqlite.dll.a write_file(${POST_INSTALL_SCRIPT} "file(REMOVE \"${CL_INSTALL_BIN}/libdapcxx.dll.a\")" APPEND) write_file(${POST_INSTALL_SCRIPT} "file(REMOVE \"${CL_INSTALL_BIN}/libdatabaselayersqlite.dll.a\")" APPEND) diff --git a/LiteEditor/context_cpp.cpp b/LiteEditor/context_cpp.cpp index 4ca54e9872..9e87d1259c 100644 --- a/LiteEditor/context_cpp.cpp +++ b/LiteEditor/context_cpp.cpp @@ -144,7 +144,6 @@ EVT_MENU(XRCID("add_multi_impl"), ContextCpp::OnAddMultiImpl) EVT_MENU(XRCID("setters_getters"), ContextCpp::OnGenerateSettersGetters) EVT_MENU(XRCID("add_include_file"), ContextCpp::OnAddIncludeFile) EVT_MENU(XRCID("add_forward_decl"), ContextCpp::OnAddForwardDecl) -EVT_MENU(XRCID("retag_file"), ContextCpp::OnRetagFile) EVT_MENU(XRCID("open_include_file"), ContextCpp::OnContextOpenDocument) END_EVENT_TABLE() @@ -1688,36 +1687,6 @@ bool ContextCpp::IsComment(long pos) const style == wxSTC_C_COMMENTDOCKEYWORDERROR); } -void ContextCpp::OnRetagFile(wxCommandEvent& e) -{ - CHECK_JS_RETURN_VOID(); - VALIDATE_WORKSPACE(); - - wxUnusedVar(e); - clEditor& editor = GetCtrl(); - if (editor.GetModify()) { - wxMessageBox(wxString::Format(_("Please save the file before retagging it"))); - return; - } - - RetagFile(); - editor.SetActive(); -} - -void ContextCpp::RetagFile() -{ - CHECK_JS_RETURN_VOID(); - if (ManagerST::Get()->GetRetagInProgress()) { - return; - } - - clEditor& editor = GetCtrl(); - ManagerST::Get()->RetagFile(editor.GetFileName().GetFullPath()); - - // incase this file is not cache this function does nothing - TagsManagerST::Get()->ClearCachedFile(editor.GetFileName().GetFullPath()); -} - void ContextCpp::OnUserTypedXChars(const wxString& word) { // user typed more than 3 chars, display completion box with C++ keywords diff --git a/LiteEditor/context_cpp.h b/LiteEditor/context_cpp.h index 55a301572f..c76d4c964c 100644 --- a/LiteEditor/context_cpp.h +++ b/LiteEditor/context_cpp.h @@ -55,7 +55,8 @@ class ContextCpp : public ContextBase bool DoCodeComplete(long pos); void DoCreateFile(const wxFileName& fn); void DoUpdateCalltipHighlight(); - size_t DoGetEntriesForHeaderAndImpl(std::vector& prototypes, std::vector& functions, + size_t DoGetEntriesForHeaderAndImpl(std::vector& prototypes, + std::vector& functions, wxString& otherfile); public: @@ -84,7 +85,6 @@ class ContextCpp : public ContextBase void AddMenuDynamicContent(wxMenu* menu) override; void RemoveMenuDynamicContent(wxMenu* menu) override; void ApplySettings() override; - void RetagFile() override; wxString CallTipContent() override; void SetActive() override; void SemicolonShift() override; @@ -120,7 +120,6 @@ class ContextCpp : public ContextBase virtual void OnMoveImpl(wxCommandEvent& e); virtual void OnAddImpl(wxCommandEvent& e); virtual void OnAddMultiImpl(wxCommandEvent& e); - virtual void OnRetagFile(wxCommandEvent& e); virtual void OnUserTypedXChars(const wxString& word); void OnCallTipClick(wxStyledTextEvent& e) override; void OnCalltipCancel() override; diff --git a/LiteEditor/fileview.cpp b/LiteEditor/fileview.cpp index 8a5408f37f..4acdb46d78 100644 --- a/LiteEditor/fileview.cpp +++ b/LiteEditor/fileview.cpp @@ -105,7 +105,6 @@ EVT_MENU(XRCID("pin_project"), FileViewTree::OnPinProject) EVT_MENU(XRCID("rebuild_project"), FileViewTree::OnReBuild) EVT_MENU(XRCID("generate_makefile"), FileViewTree::OnRunPremakeStep) EVT_MENU(XRCID("stop_build"), FileViewTree::OnStopBuild) -EVT_MENU(XRCID("retag_project"), FileViewTree::OnRetagProject) EVT_MENU(XRCID("build_project_only"), FileViewTree::OnBuildProjectOnly) EVT_MENU(XRCID("clean_project_only"), FileViewTree::OnCleanProjectOnly) EVT_MENU(XRCID("rebuild_project_only"), FileViewTree::OnRebuildProjectOnly) @@ -140,8 +139,6 @@ EVT_UPDATE_UI(XRCID("build_order"), FileViewTree::OnBuildInProgress) EVT_UPDATE_UI(XRCID("clean_project"), FileViewTree::OnBuildInProgress) EVT_UPDATE_UI(XRCID("build_project"), FileViewTree::OnBuildInProgress) EVT_UPDATE_UI(XRCID("rebuild_project"), FileViewTree::OnBuildInProgress) -EVT_UPDATE_UI(XRCID("retag_project"), FileViewTree::OnRetagInProgressUI) -EVT_UPDATE_UI(XRCID("retag_workspace"), FileViewTree::OnRetagInProgressUI) EVT_UPDATE_UI(XRCID("build_project_only"), FileViewTree::OnBuildInProgress) EVT_UPDATE_UI(XRCID("clean_project_only"), FileViewTree::OnBuildInProgress) EVT_UPDATE_UI(XRCID("rebuild_project_only"), FileViewTree::OnBuildInProgress) @@ -1335,22 +1332,6 @@ size_t FileViewTree::GetMultiSelection(wxArrayTreeItemIds& arr) } } -void FileViewTree::OnRetagProject(wxCommandEvent& event) -{ - wxUnusedVar(event); - wxTreeItemId item = GetSingleSelection(); - if (item.IsOk()) { - wxString projectName = GetItemText(item); - ManagerST::Get()->RetagProject(projectName, true); - } -} - -void FileViewTree::OnRetagWorkspace(wxCommandEvent& event) -{ - wxUnusedVar(event); - ManagerST::Get()->RetagWorkspace(TagsManager::Retag_Quick); -} - void FileViewTree::OnItemBeginDrag(wxTreeEvent& event) { wxArrayTreeItemIds selections; @@ -2060,11 +2041,6 @@ void FileViewTree::OnLocalWorkspaceSettings(wxCommandEvent& e) } } -void FileViewTree::OnRetagInProgressUI(wxUpdateUIEvent& event) -{ - event.Enable(!ManagerST::Get()->GetRetagInProgress()); -} - void FileViewTree::OnOpenWithDefaultApplication(wxCommandEvent& event) { wxArrayTreeItemIds items; @@ -2433,10 +2409,6 @@ void FileViewTree::OnFolderDropped(clCommandEvent& event) evtOpenworkspace.SetEventObject(clMainFrame::Get()); clMainFrame::Get()->GetEventHandler()->AddPendingEvent(evtOpenworkspace); } - - // And trigger a full reparse of the workspace - wxCommandEvent evtOpenworkspace(wxEVT_MENU, XRCID("full_retag_workspace")); - clMainFrame::Get()->GetEventHandler()->AddPendingEvent(evtOpenworkspace); } void FileViewTree::FolderDropped(const wxArrayString& folders) diff --git a/LiteEditor/fileview.h b/LiteEditor/fileview.h index feb7a2415f..8db988a6e6 100644 --- a/LiteEditor/fileview.h +++ b/LiteEditor/fileview.h @@ -164,11 +164,8 @@ class FileViewTree : public clThemedTreeCtrl virtual void OnCleanProjectOnly(wxCommandEvent& event); virtual void OnRebuildProjectOnly(wxCommandEvent& event); virtual void OnStopBuild(wxCommandEvent& event); - virtual void OnRetagProject(wxCommandEvent& event); - virtual void OnRetagWorkspace(wxCommandEvent& event); virtual void OnBuildInProgress(wxUpdateUIEvent& event); virtual void OnExcludeFromBuildUI(wxUpdateUIEvent& event); - virtual void OnRetagInProgressUI(wxUpdateUIEvent& event); virtual void OnItemBeginDrag(wxTreeEvent& event); virtual void OnItemEndDrag(wxTreeEvent& event); virtual void OnImportDirectory(wxCommandEvent& e); diff --git a/LiteEditor/frame.cpp b/LiteEditor/frame.cpp index 4552a57f18..19ed1adbcb 100644 --- a/LiteEditor/frame.cpp +++ b/LiteEditor/frame.cpp @@ -23,6 +23,8 @@ ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// +#include "precompiled_header.h" + #include "frame.h" #include "BreakpointsView.hpp" @@ -101,7 +103,6 @@ #include "plugin.h" #include "pluginmanager.h" #include "pluginmgrdlg.h" -#include "precompiled_header.h" #include "project.h" #include "quickdebugdlg.h" #include "resources/clXmlResource.hpp" @@ -457,8 +458,6 @@ EVT_MENU(XRCID("new_project"), clMainFrame::OnProjectNewProject) EVT_MENU(XRCID("file_new_project"), clMainFrame::OnProjectNewProject) EVT_MENU(XRCID("add_project"), clMainFrame::OnProjectAddProject) EVT_MENU(XRCID("reconcile_project"), clMainFrame::OnReconcileProject) -EVT_MENU(XRCID("retag_workspace"), clMainFrame::OnRetagWorkspace) -EVT_MENU(XRCID("full_retag_workspace"), clMainFrame::OnRetagWorkspace) EVT_MENU(XRCID("project_properties"), clMainFrame::OnShowActiveProjectSettings) EVT_MENU(XRCID("set_active_project"), clMainFrame::OnSetActivePoject) @@ -471,8 +470,6 @@ EVT_UPDATE_UI(XRCID("add_project"), clMainFrame::OnWorkspaceMenuUI) EVT_UPDATE_UI(XRCID("file_new_project"), clMainFrame::OnWorkspaceOpen) EVT_UPDATE_UI(XRCID("new_project"), clMainFrame::OnNewProjectUI) EVT_UPDATE_UI(XRCID("reconcile_project"), clMainFrame::OnShowActiveProjectSettingsUI) -EVT_UPDATE_UI(XRCID("retag_workspace"), clMainFrame::OnRetagWorkspaceUI) -EVT_UPDATE_UI(XRCID("full_retag_workspace"), clMainFrame::OnRetagWorkspaceUI) EVT_UPDATE_UI(XRCID("project_properties"), clMainFrame::OnShowActiveProjectSettingsUI) EVT_UPDATE_UI(XRCID("set_active_project"), clMainFrame::OnSetActivePojectUI) @@ -1229,8 +1226,7 @@ void clMainFrame::AddKeyboardAccelerators() {"import_from_msvs", _("Import other IDEs solution/workspace files...")}, {"project_properties", _("Open Active Project Settings..."), "Alt-F7"}, {"new_project", _("Create New Project")}, - {"add_project", _("Add an Existing Project")}, - {"full_retag_workspace", _("Parse Workspace")}}); + {"add_project", _("Add an Existing Project")}}); } clMainFrame* clMainFrame::Get() { return m_theFrame; } @@ -2461,10 +2457,6 @@ void clMainFrame::OnCtagsOptions(wxCommandEvent& event) if ((newColVars != colVars) || (colourTypes != m_tagsOptionsData.GetCcColourFlags())) { GetMainBook()->UpdateColours(); } - - // When new include paths were added, an incremental parse is enough - wxCommandEvent e(wxEVT_MENU, XRCID("retag_workspace")); - AddPendingEvent(e); } void clMainFrame::RegisterDockWindow(int menuItemId, const wxString& name) @@ -2951,16 +2943,6 @@ void clMainFrame::OnTimer(wxTimerEvent& event) NavMgr::Get()->Clear(); } - // ReTag workspace database if needed (this can happen due to schema version changes) - // It is important to place the retag code here since the retag workspace should take place after - // the parser search path have been updated (if needed) - if (m_workspaceRetagIsRequired) { - m_workspaceRetagIsRequired = false; - wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, XRCID("full_retag_workspace")); - this->AddPendingEvent(evt); - m_infoBar->DisplayMessage(_("A workspace reparse is needed"), wxICON_INFORMATION); - } - // For some reason, under Linux we need to force the menu accelerator again // otherwise some shortcuts are getting lose (e.g. Ctrl-/ to comment line) ManagerST::Get()->UpdateMenuAccelerators(); @@ -4658,31 +4640,6 @@ void clMainFrame::OnIncrementalReplace(wxCommandEvent& event) GetMainBook()->ShowQuickBar(true); } -void clMainFrame::OnRetagWorkspace(wxCommandEvent& event) -{ - // See if any of the plugins want to handle this event by itself - bool fullRetag = !(event.GetId() == XRCID("retag_workspace")); - wxCommandEvent e(fullRetag ? wxEVT_CMD_RETAG_WORKSPACE_FULL : wxEVT_CMD_RETAG_WORKSPACE, GetId()); - e.SetEventObject(this); - if (EventNotifier::Get()->ProcessEvent(e)) { - return; - } - - TagsManager::RetagType type = TagsManager::Retag_Quick_No_Scan; - if (event.GetId() == XRCID("retag_workspace")) { - type = TagsManager::Retag_Quick; - } - - else if (event.GetId() == XRCID("full_retag_workspace")) { - type = TagsManager::Retag_Full; - } - - else if (event.GetId() == XRCID("retag_workspace_no_includes")) { - type = TagsManager::Retag_Quick_No_Scan; - } - ManagerST::Get()->RetagWorkspace(type); -} - void clMainFrame::OnShowBuiltInTerminal(wxCommandEvent& e) { wxUnusedVar(e); @@ -5102,8 +5059,6 @@ void clMainFrame::UpdateAUI() m_mgr.Update(); } -void clMainFrame::OnRetagWorkspaceUI(wxUpdateUIEvent& event) { CHECK_SHUTDOWN(); } - void clMainFrame::OnViewWordWrap(wxCommandEvent& e) { CHECK_SHUTDOWN(); diff --git a/LiteEditor/frame.h b/LiteEditor/frame.h index 83b801a3af..a413beb37e 100644 --- a/LiteEditor/frame.h +++ b/LiteEditor/frame.h @@ -526,7 +526,6 @@ class clMainFrame : public wxFrame void OnReconcileProject(wxCommandEvent& event); void OnWorkspaceOpen(wxUpdateUIEvent& event); void OnNewProjectUI(wxUpdateUIEvent& event); - void OnRetagWorkspaceUI(wxUpdateUIEvent& event); void OnAddEnvironmentVariable(wxCommandEvent& event); void OnAdvanceSettings(wxCommandEvent& event); void OnCtagsOptions(wxCommandEvent& event); @@ -536,7 +535,6 @@ class clMainFrame : public wxFrame void OnShowBuildMenu(wxCommandEvent& e); void OnBuildAndRunProject(wxCommandEvent& event); void OnRebuildProject(wxCommandEvent& event); - void OnRetagWorkspace(wxCommandEvent& event); void OnBuildProjectUI(wxUpdateUIEvent& event); void OnStopBuild(wxCommandEvent& event); void OnStopBuildUI(wxUpdateUIEvent& event); diff --git a/LiteEditor/mainbook.cpp b/LiteEditor/mainbook.cpp index 61d9e4770a..f213baadf5 100644 --- a/LiteEditor/mainbook.cpp +++ b/LiteEditor/mainbook.cpp @@ -1031,18 +1031,6 @@ void MainBook::ReloadExternallyModified(bool prompt) // reset the recursive protector depth = wxNOT_FOUND; - - std::vector filesToRetag; - for (size_t i = 0; i < files.size(); i++) { - if (files[i].second) { - editors[i]->ReloadFromDisk(true); - filesToRetag.push_back(files[i].first); - } - } - - if (filesToRetag.size() > 1) { - TagsManagerST::Get()->ParseWorkspaceIncremental(); - } } bool MainBook::ClosePage(wxWindow* page) diff --git a/LiteEditor/manager.cpp b/LiteEditor/manager.cpp index 7b7eef22a7..b80a2d253e 100644 --- a/LiteEditor/manager.cpp +++ b/LiteEditor/manager.cpp @@ -259,7 +259,6 @@ Manager::Manager() , m_tipWinPos(wxNOT_FOUND) , m_frameLineno(wxNOT_FOUND) , m_watchDlg(NULL) - , m_retagInProgress(false) { Bind(wxEVT_RESTART_CODELITE, &Manager::OnRestart, this); Bind(wxEVT_FORCE_RESTART_CODELITE, &Manager::OnForcedRestart, this); @@ -649,7 +648,6 @@ void Manager::CreateProject(ProjectData& data, const wxString& workspaceFolder) } wxString projectName = proj->GetName(); - RetagProject(projectName, true); // Update the parser search paths CallAfter(&Manager::UpdateParserPaths, false); @@ -681,7 +679,6 @@ void Manager::AddProject(const wxString& path) wxFileName fn(path); wxString projectName(fn.GetName()); - RetagProject(projectName, true); clCommandEvent evtProjectAdded(wxEVT_PROJ_ADDED); evtProjectAdded.SetString(projectName); @@ -879,21 +876,6 @@ void Manager::GetWorkspaceFiles(std::vector& files, bool absPath) } } -void Manager::RetagWorkspace(TagsManager::RetagType type) -{ - if (!clWorkspaceManager::Get().IsWorkspaceOpened()) { - return; - } - - if (type == TagsManager::Retag_Quick) { - TagsManagerST::Get()->ParseWorkspaceIncremental(); - } else { - TagsManagerST::Get()->ParseWorkspaceFull(clWorkspaceManager::Get().GetWorkspace()->GetDir()); - } -} - -void Manager::RetagFile(const wxString& filename) { wxUnusedVar(filename); } - //--------------------------- Project Files Mgmt ----------------------------- int Manager::AddVirtualDirectory(const wxString& virtualDirFullPath, bool createIt) @@ -1046,11 +1028,6 @@ void Manager::AddFilesToProject(const wxArrayString& files, const wxString& vdFu vFiles.push_back(actualAdded.Item(i)); } - // re-tag the added files - if (vFiles.empty() == false) { - TagsManagerST::Get()->ParseWorkspaceIncremental(); - } - if (!actualAdded.IsEmpty()) { clCommandEvent evtAddFiles(wxEVT_PROJ_FILE_ADDED); evtAddFiles.SetStrings(actualAdded); @@ -1123,9 +1100,6 @@ bool Manager::RenameFile(const wxString& origName, const wxString& newName, cons ProjectPtr proj = GetProject(projName); proj->FastAddFile(newName, vdFullPath.AfterFirst(wxT(':'))); - // Step 3: retag the new file - RetagFile(newName); - // Step 4: send an event about new file was added // to the workspace wxArrayString files; @@ -1249,7 +1223,6 @@ void Manager::RetagProject(const wxString& projectName, bool quickRetag) { wxUnusedVar(projectName); wxUnusedVar(quickRetag); - TagsManagerST::Get()->ParseWorkspaceIncremental(); } void Manager::GetProjectFiles(const wxString& project, wxArrayString& files) diff --git a/LiteEditor/manager.h b/LiteEditor/manager.h index 3aafbb782d..27604882fd 100644 --- a/LiteEditor/manager.h +++ b/LiteEditor/manager.h @@ -95,7 +95,6 @@ class Manager : public wxEvtHandler, public IDebuggerObserver std::list m_buildQueue; wxArrayString m_dbgWatchExpressions; DisplayVariableDlg* m_watchDlg; - bool m_retagInProgress; DbgStackInfo m_dbgCurrentFrameInfo; PerspectiveManager m_perspectiveManager; clDebuggerTerminalPOSIX m_debuggerTerminal; @@ -111,9 +110,6 @@ class Manager : public wxEvtHandler, public IDebuggerObserver PerspectiveManager& GetPerspectiveManager() { return m_perspectiveManager; } - void SetRetagInProgress(bool retagInProgress) { this->m_retagInProgress = retagInProgress; } - bool GetRetagInProgress() const { return m_retagInProgress; } - const wxString& GetOriginalCwd() const { return m_originalCwd; } void SetOriginalCwd(const wxString& path) { m_originalCwd = path; } @@ -298,17 +294,6 @@ class Manager : public wxEvtHandler, public IDebuggerObserver */ void GetWorkspaceFiles(std::vector& files, bool absPath = false); - /** - * retag workspace - */ - void RetagWorkspace(TagsManager::RetagType type); - - /** - * @brief retag a given file - * @param filename - */ - void RetagFile(const wxString& filename); - /** * @brief Launch the ParseThread to update the preprocessor visualization * @param filename diff --git a/Plugin/FileSystemWorkspace/clFileSystemWorkspace.cpp b/Plugin/FileSystemWorkspace/clFileSystemWorkspace.cpp index 5dc593d925..2ab453344f 100644 --- a/Plugin/FileSystemWorkspace/clFileSystemWorkspace.cpp +++ b/Plugin/FileSystemWorkspace/clFileSystemWorkspace.cpp @@ -60,8 +60,6 @@ clFileSystemWorkspace::clFileSystemWorkspace(bool dummy) EventNotifier::Get()->Bind(wxEVT_CMD_CREATE_NEW_WORKSPACE, &clFileSystemWorkspace::OnNewWorkspace, this); EventNotifier::Get()->Bind(wxEVT_ALL_EDITORS_CLOSED, &clFileSystemWorkspace::OnAllEditorsClosed, this); EventNotifier::Get()->Bind(wxEVT_FS_SCAN_COMPLETED, &clFileSystemWorkspace::OnScanCompleted, this); - EventNotifier::Get()->Bind(wxEVT_CMD_RETAG_WORKSPACE, &clFileSystemWorkspace::OnParseWorkspace, this); - EventNotifier::Get()->Bind(wxEVT_CMD_RETAG_WORKSPACE_FULL, &clFileSystemWorkspace::OnParseWorkspace, this); EventNotifier::Get()->Bind(wxEVT_SAVE_SESSION_NEEDED, &clFileSystemWorkspace::OnSaveSession, this); EventNotifier::Get()->Bind(wxEVT_SOURCE_CONTROL_PULLED, &clFileSystemWorkspace::OnSourceControlPulled, this); @@ -104,8 +102,6 @@ clFileSystemWorkspace::~clFileSystemWorkspace() EventNotifier::Get()->Unbind(wxEVT_SAVE_SESSION_NEEDED, &clFileSystemWorkspace::OnSaveSession, this); // parsing event - EventNotifier::Get()->Unbind(wxEVT_CMD_RETAG_WORKSPACE, &clFileSystemWorkspace::OnParseWorkspace, this); - EventNotifier::Get()->Unbind(wxEVT_CMD_RETAG_WORKSPACE_FULL, &clFileSystemWorkspace::OnParseWorkspace, this); EventNotifier::Get()->Unbind(wxEVT_SOURCE_CONTROL_PULLED, &clFileSystemWorkspace::OnSourceControlPulled, this); // Build events @@ -439,36 +435,11 @@ void clFileSystemWorkspace::OnScanCompleted(clFileSystemEvent& event) } clGetManager()->SetStatusMessage(_("File system scan completed")); - // Trigger a non full reparse - Parse(false); - clDEBUG() << "Sending wxEVT_WORKSPACE_FILES_SCANNED event..." << endl; clWorkspaceEvent event_scan{wxEVT_WORKSPACE_FILES_SCANNED}; EventNotifier::Get()->ProcessEvent(event_scan); } -void clFileSystemWorkspace::OnParseWorkspace(wxCommandEvent& event) -{ - if (!m_isLoaded) { - event.Skip(); - return; - } - Parse(event.GetInt() == (event.GetEventType() == wxEVT_CMD_RETAG_WORKSPACE)); -} - -void clFileSystemWorkspace::Parse(bool fullParse) -{ - if (m_files.IsEmpty()) { - return; - } - - if (fullParse) { - TagsManagerST::Get()->ParseWorkspaceFull(GetDir()); - } else { - TagsManagerST::Get()->ParseWorkspaceIncremental(); - } -} - void clFileSystemWorkspace::Close() { DoClose(); } wxString clFileSystemWorkspace::GetTargetCommand(const wxString& target) const @@ -1073,9 +1044,6 @@ void clFileSystemWorkspace::OnFileSystemUpdated(clFileSystemEvent& event) for (const wxString& path : paths) { m_files.Add(path); } - - // Parse the newly added files - Parse(false); } } diff --git a/Plugin/FileSystemWorkspace/clFileSystemWorkspace.hpp b/Plugin/FileSystemWorkspace/clFileSystemWorkspace.hpp index 0703e7e7f4..0751740f79 100644 --- a/Plugin/FileSystemWorkspace/clFileSystemWorkspace.hpp +++ b/Plugin/FileSystemWorkspace/clFileSystemWorkspace.hpp @@ -64,7 +64,6 @@ class WXDLLIMPEXP_SDK clFileSystemWorkspace : public LocalWorkspaceCommon void OnCloseWorkspace(clCommandEvent& event); void OnAllEditorsClosed(wxCommandEvent& event); void OnScanCompleted(clFileSystemEvent& event); - void OnParseWorkspace(wxCommandEvent& event); void OnBuildProcessTerminated(clProcessEvent& event); void OnBuildProcessOutput(clProcessEvent& event); void OnSaveSession(clCommandEvent& event); @@ -158,11 +157,6 @@ class WXDLLIMPEXP_SDK clFileSystemWorkspace : public LocalWorkspaceCommon */ void Save(bool parse); - /** - * @brief parse the workspace - */ - void Parse(bool fullParse); - /** * @brief is this workspace opened? */ diff --git a/Plugin/LSP/LSPDetectorManager.cpp b/Plugin/LSP/LSPDetectorManager.cpp index 6b3c7fa5a2..134ecabcbc 100644 --- a/Plugin/LSP/LSPDetectorManager.cpp +++ b/Plugin/LSP/LSPDetectorManager.cpp @@ -1,7 +1,6 @@ #include "LSPDetectorManager.hpp" #include "detectors/LSPCMakeDetector.hpp" -#include "detectors/LSPCTagsdDetector.hpp" #include "detectors/LSPClangdDetector.hpp" #include "detectors/LSPGoplsDetector.hpp" #include "detectors/LSPJdtlsDetector.hpp" @@ -18,7 +17,6 @@ LSPDetectorManager::LSPDetectorManager() m_detectors.push_back(LSPDetector::Ptr_t(new LSPPythonDetector())); m_detectors.push_back(LSPDetector::Ptr_t(new LSPRustAnalyzerDetector())); m_detectors.push_back(LSPDetector::Ptr_t(new LSPTypeScriptDetector())); - m_detectors.push_back(LSPDetector::Ptr_t(new LSPCTagsdDetector())); m_detectors.push_back(LSPDetector::Ptr_t(new LSPCMakeDetector())); m_detectors.push_back(LSPDetector::Ptr_t(new LSPJdtlsDetector())); m_detectors.push_back(LSPDetector::Ptr_t(new LSPGoplsDetector())); diff --git a/Plugin/LSP/LSPManager.cpp b/Plugin/LSP/LSPManager.cpp index 5eb040987a..b0f68361f5 100644 --- a/Plugin/LSP/LSPManager.cpp +++ b/Plugin/LSP/LSPManager.cpp @@ -774,64 +774,6 @@ void Manager::StartServer(const LanguageServerEntry& entry) LanguageServerProtocol::Ptr_t lsp(new LanguageServerProtocol(entry.GetName(), entry.GetNetType(), this)); lsp->SetDisplayDiagnostics(entry.IsDisplayDiagnostics()); - if (lsp->GetName() == "ctagsd") { - // set startup callback - auto cb = [=]() { - if (!clWorkspaceManager::Get().IsWorkspaceOpened()) { - return; - } - - wxFileName fn(clWorkspaceManager::Get().GetWorkspace()->GetDir(), wxEmptyString); - fn.AppendDir(".ctagsd"); - fn.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL); - - wxFileName settings_json(fn.GetPath(), "ctagsd.json"); - { - if (!settings_json.FileExists()) { - // create an empty json object file - FileUtils::WriteFileContent(settings_json, "{}"); - } else { - // the file exists, ensure its a valid json - JSON root(settings_json); - if (!root.isOk()) { - FileUtils::WriteFileContent(settings_json, "{}"); - } - } - } - - JSON root(settings_json); - JSONItem json = root.toElement(); - - if (json.hasNamedObject("limit_results")) { - json.removeProperty("limit_results"); - LSP_DEBUG() << "ctagsd: found limit_results -> removing it" << endl; - } - - // update the entries - if (json.hasNamedObject("codelite_indexer")) { - json.removeProperty("codelite_indexer"); - LSP_DEBUG() << "ctagsd: found codelite_indexer -> removing it" << endl; - } - - json.addProperty("codelite_indexer", clStandardPaths::Get().GetBinaryFullPath("codelite-ctags")); - json.addProperty("limit_results", TagsManagerST::Get()->GetCtagsOptions().GetCcNumberOfDisplayItems()); - root.save(settings_json); - LSP_DEBUG() << "ctagsd: writing new file:" << settings_json << endl; - - // create the file_list.txt file - wxFileName file_list(fn.GetPath(), "file_list.txt"); - wxArrayString files; - clWorkspaceManager::Get().GetWorkspace()->GetWorkspaceFiles(files); - - wxString file_list_content; - for (const auto& filepath : files) { - file_list_content << filepath << "\n"; - } - FileUtils::WriteFileContent(file_list, file_list_content); - }; - lsp->SetStartedCallback(std::move(cb)); - } - bool is_remote = m_remoteHelper->IsRemoteWorkspaceOpened(); wxString command; wxString working_directory; diff --git a/Plugin/LSP/detectors/LSPCTagsdDetector.cpp b/Plugin/LSP/detectors/LSPCTagsdDetector.cpp deleted file mode 100644 index a279a34445..0000000000 --- a/Plugin/LSP/detectors/LSPCTagsdDetector.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "LSPCTagsdDetector.hpp" - -#include "StringUtils.h" -#include "cl_standard_paths.h" - -#include - -LSPCTagsdDetector::LSPCTagsdDetector() - : LSPDetector("ctagsd") -{ -} - -bool LSPCTagsdDetector::DoLocate() -{ - wxFileName ctagsd(clStandardPaths::Get().GetBinaryFullPath("ctagsd")); - if(ctagsd.FileExists()) { - ConfigureFile(ctagsd); - return true; - } - return false; -} - -void LSPCTagsdDetector::ConfigureFile(const wxFileName& ctagsd_exe) -{ - LSP_DEBUG() << "==> Found" << ctagsd_exe << endl; - wxString command; - command << ctagsd_exe.GetFullPath(); - StringUtils::WrapWithQuotes(command); - - command << " --port 45634 --log-level ERR"; - SetCommand(command); - // Add support for the languages - GetLanguages().Add("c"); - GetLanguages().Add("cpp"); - SetConnectionString("tcp://127.0.0.1:45634"); - SetEnabled(false); -} diff --git a/Plugin/LSP/detectors/LSPCTagsdDetector.hpp b/Plugin/LSP/detectors/LSPCTagsdDetector.hpp deleted file mode 100644 index f791f8a7b3..0000000000 --- a/Plugin/LSP/detectors/LSPCTagsdDetector.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef LSPCTAGSDDETECTOR_HPP -#define LSPCTAGSDDETECTOR_HPP - -#include "LSPDetector.hpp" -#include "codelite_exports.h" - -#include - -class WXDLLIMPEXP_SDK LSPCTagsdDetector : public LSPDetector -{ -private: - void ConfigureFile(const wxFileName& clangdExe); - -public: - LSPCTagsdDetector(); - ~LSPCTagsdDetector() = default; - - bool DoLocate() override; -}; - -#endif // LSPCTAGSDDETECTOR_HPP diff --git a/Plugin/workspace.cpp b/Plugin/workspace.cpp index a79dae6457..91df1163c1 100644 --- a/Plugin/workspace.cpp +++ b/Plugin/workspace.cpp @@ -162,13 +162,9 @@ bool clCxxWorkspace::CreateWorkspace(const wxString& name, const wxString& path, ::wxSetWorkingDirectory(m_fileName.GetPath()); m_buildMatrix = nullptr; - wxFileName dbFileName = GetTagsFileName(); - TagsManagerST::Get()->OpenDatabase(dbFileName); - wxXmlNode* root = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, wxT("CodeLite_Workspace")); m_doc.SetRoot(root); m_doc.GetRoot()->AddAttribute(wxT("Name"), name); - m_doc.GetRoot()->AddAttribute(wxT("Database"), dbFileName.GetFullPath(wxPATH_UNIX)); m_doc.GetRoot()->DeleteAttribute(wxT("SWTLW")); if (GetLocalWorkspace()->GetParserFlags() & LocalWorkspace::EnableSWTLW) { diff --git a/Runtime/rc/menu.macos.xrc b/Runtime/rc/menu.macos.xrc index 125d634704..97c7c1cbf7 100644 --- a/Runtime/rc/menu.macos.xrc +++ b/Runtime/rc/menu.macos.xrc @@ -533,11 +533,6 @@ - - - - Reparse the workspace - diff --git a/Runtime/rc/menu.xrc b/Runtime/rc/menu.xrc index dce6f0f439..e107e186b8 100644 --- a/Runtime/rc/menu.xrc +++ b/Runtime/rc/menu.xrc @@ -524,11 +524,6 @@ - - - - Reparse the workspace - diff --git a/docs/docs/plugins/lsp.md b/docs/docs/plugins/lsp.md index 7c0fa07838..8bbb9578e7 100644 --- a/docs/docs/plugins/lsp.md +++ b/docs/docs/plugins/lsp.md @@ -53,12 +53,6 @@ brew install llvm On ARM-based macOS systems, `clangd` is located at `/opt/homebrew/opt/llvm/bin/clangd`. -### ctagsd (C/C++) - -`ctagsd` is CodeLite's built-in code completion engine for C/C++ that implements the Language Server Protocol. It is automatically installed with CodeLite on all platforms. - -CodeLite pre-configures `ctagsd`, but it is disabled by default. To enable it, navigate to **Plugins → Language Server → Settings**. - ### Pyright (Python) **Prerequisites** @@ -219,7 +213,7 @@ You can install and configure any language server that implements the LSP protoc ### Resolving Conflicts -Multiple language servers can be configured for the same programming language (e.g., both `ctagsd` and `clangd` for C++). However, ensure that only one is enabled at a time to avoid conflicts. +Multiple language servers can be configured for the same programming language. However, ensure that only one is enabled at a time to avoid conflicts. --- @@ -235,19 +229,19 @@ To restart any language server: ## CMake Integration -### Using clangd and ctagsd with CMake +### Using clangd with CMake -Both `clangd` and `ctagsd` rely on `compile_flags.txt` or `compile_commands.json` files for build instructions. These language servers search for these files starting from the active file's directory and traversing up the parent directories until a match is found. +`clangd` relies on either `compile_flags.txt` or `compile_commands.json` to obtain build instructions. It searches for these files starting from the active file’s directory and moving up through the parent directories until a matching file is found. -If both files exist in the same directory, `compile_flags.txt` takes precedence. +If both files are present in the same directory, `compile_flags.txt` takes precedence. **CodeLite Default C++ Workspace** -When using CodeLite's [default C++ workspace](../workspaces/default.md), these files are generated automatically after the build process completes. +When using CodeLite’s [default C++ workspace](../workspaces/default.md), these files are generated automatically after the build process completes. **Other Workspace Types** -When using other workspace types (e.g., [File System Workspace](../workspaces/file_system.md)), you must provide at least one of these files manually for `clangd` code completion to function. +When using other workspace types, such as the [File System Workspace](../workspaces/file_system.md), you must manually provide at least one of these files for `clangd` code completion to work. ### Generating compile_commands.json with CMake diff --git a/wxcrafter/src/wxcrafter_plugin.cpp b/wxcrafter/src/wxcrafter_plugin.cpp index ebaad8537e..92fb6edbb9 100644 --- a/wxcrafter/src/wxcrafter_plugin.cpp +++ b/wxcrafter/src/wxcrafter_plugin.cpp @@ -686,11 +686,6 @@ void wxCrafterPlugin::OnBitmapCodeGenerationCompleted(wxCommandEvent& e) wxString msg; msg << _("wxCrafter: code generation completed successfully!"); wxCrafter::SetStatusMessage(msg); - - // Restart ctagsd - clLanguageServerEvent restart_event{wxEVT_LSP_RESTART}; - restart_event.SetLspName("ctagsd"); - EventNotifier::Get()->ProcessEvent(restart_event); } wxMenu* wxCrafterPlugin::DoCreateFolderMenu()