Thank you Pecan.
In the change applied in svn, menu item is added after astyle menu item. But if I disable astyle plugin, this leads to context menu not working.
Edit:
Following change fixes the issue.
diff --git a/src/plugins/contrib/clangd_client/src/codecompletion/codecompletion.cpp b/src/plugins/contrib/clangd_client/src/codecompletion/codecompletion.cpp
index 0964bbd37..e122e4823 100644
--- a/src/plugins/contrib/clangd_client/src/codecompletion/codecompletion.cpp
+++ b/src/plugins/contrib/clangd_client/src/codecompletion/codecompletion.cpp
@@ -1073,11 +1073,9 @@ void ClgdCompletion::BuildModuleMenu(const ModuleType type, wxMenu* menu, const
const wxString labelAStyle = _("Format use AStyle");
const wxString label = _("Format use Clangd"); // (christo 25/05/02)
int position = Manager::Get()->GetPluginManager()->FindSortedMenuItemPosition(*menu, labelAStyle);
- wxMenuItem* item = menu->FindItemByPosition(position);
- if (item) {
- wxString itemLabel = item->GetItemLabelText();
- if (itemLabel == labelAStyle)
- position += 1;
+ if (position != menu->GetMenuItemCount())
+ {
+ position += 1;
}
menu->Insert(position, idCodeFormatterActiveFile, label, _("Format the selected source code (selected line) in the current file"));