<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font face="Noto Sans">I'm trying to make a language plugin for
my own language I used in projects but I'm wrestling left and
right with creating a language plugin for KDevelop since the
documentation is next to non-existent.</font></p>
<p><font face="Noto Sans">So far I managed to set up the plugin stub
using the new plugin template from KDevelop. The plugin is
correctly showing up in the "Language Support" category. The
basic stub looks like this:</font></p>
<p><font face="Noto Sans">class kdev_lang_dscript : public
KDevelop::IPlugin, public KDevelop::ILanguageSupport {<br>
Q_OBJECT<br>
Q_INTERFACES(KDevelop::ILanguageSupport)<br>
public:<br>
kdev_lang_dscript(QObject* parent, const QVariantList&
args);<br>
virtual ~kdev_lang_dscript();<br>
virtual QString name() const;<br>
virtual KDevelop::ParseJob *createParseJob(const
KDevelop::IndexedString &url);<br>
};<br>
</font></p>
<p><font face="Noto Sans">I've placed qDebug()<< calls in all
methods to check what is called. I've adjusted the JSON file
generated by the template to match up:</font></p>
<p><font face="Noto Sans">{<br>
"KPlugin": {<br>
"Category": "Language Support",<br>
"Id": "dragonscriptlanguagesupport",<br>
"License": "GPL",<br>
"Name": "DragonScript Language Support",<br>
"Name[x-test]": "xxDragonScript Language Supportxx",<br>
"Description": "DragonScript Language Plugin",<br>
"Description[x-test]": "xxDragonScript Language
Pluginxx",<br>
"ServiceTypes": [<br>
"KDevelop/Plugin"<br>
]<br>
},<br>
"X-KDevelop-Interfaces": [<br>
"ILanguageSupport"<br>
],<br>
"X-KDevelop-Languages": [<br>
"DragonScript"<br>
],<br>
"X-KDevelop-Category": "Global",<br>
"X-KDevelop-Mode": "NoGUI",<br>
"X-KDevelop-SupportedMimeTypes": [<br>
"text/x-dragonscript"<br>
]<br>
}<br>
</font></p>
<p><font face="Noto Sans">I'm installing the plugin into a separate
directory running a test-session in another KDevelop instance
using (-s plugintest) and QT_PLUGIN_PATH set to include the
path. I see that the module is loaded. The constructor and
destructor is called. When I load up a source file nothing
happens. I do not see createParseJob() being ever called. Even
if I add stubs for all other virtual methods in ILanguageSupport
riddled with qDebug()<< I see none of these methods being
called.</font></p>
<p><font face="Noto Sans">What else do I need to to to get my
language plugin being used for source files with the right extension?
There exists no mime-type for this language in the system
obviously so can this be done by using file extensions?</font></p>
<p><font face="Noto Sans">- Regards<br>
</font></p>
</body>
</html>