kate-ctags plugin not working
René J.V. Bertin
rjvbertin at gmail.com
Fri Nov 9 09:52:37 GMT 2018
Friedrich W. H. Kossebau wrote:
>> QMetaObject::invokeMethod: No such method
>> KTextEditorIntegration::MainWindow::showToolView(QWidget *)
>
> The latter is quickly explained:
[...]
> maintained, no C++ interface class is used here for whatever reason, thus no
I think the reason is clear: using a mechanism akin to ObjC's respondsToSelector: means KTextEditor::MainWindow can evolve freely without worrying about API or ABI compatibility in existing plugins (binaries and source).
> So this needs fixing with a patch which adds the implementations of those
> missing methods to KTextEditorIntegration::MainWindow to do whatever is needed
> to do within KDevelop's platform.
This works:
KTextEditor::View *MainWindow::openUrl(const QUrl &url, const QString &encoding)
{
Q_UNUSED(encoding);
auto documentController = Core::self()->documentControllerInternal();
auto doc = url.isEmpty() ? documentController->openDocumentFromText(QString()) : documentController->openDocument(url);
return doc ? doc->activeTextView() : nullptr;
}
This even positions the cursor correctly so clearly the plugin can work in KDevelop and provide currently missing functionality (curiously I need to use "go to declaration" instead of definition for TCL but that must be an unrelated issue).
I cannot get the showToolView() method to do anything though. This WIP implementation clearly tries to raise the correct toolview but has 0 effect. So either I misunderstand what the the method is supposed to do or else this is related somehow to the fact that the toolview shows a garbled UI (looks as if its layout area isn't sized properly):
bool MainWindow::showToolView(QWidget *widget)
{
const auto view = ToolViewFactory::fromWidget(widget);
if (view) {
Core::self()->uiController()->raiseToolView(widget);
qWarning() << Q_FUNC_INFO << view << view->m_text;
return true;
}
qWarning() << Q_FUNC_INFO << "no ToolViewFactory for" << widget;
return false;
}
(relies on a few temporary tweaks to the ToolViewFactory class).
I looked for clues in the git history of Kate's other plugins that are supported in KDevelop but didn't find anything relevant (= labelled KDevelop). There was a change to the snippets plugin toolbar, but the CTags plugin doesn't have one...
R.
More information about the KDevelop-devel
mailing list