diff --git a/interfaces/iplugin.h b/interfaces/iplugin.h --- a/interfaces/iplugin.h +++ b/interfaces/iplugin.h @@ -75,7 +75,7 @@ * X-KDevelop-Category= * X-KDevelop-Mode=GUI * X-KDevelop-LoadMode= - * X-KDevelop-Language= + * X-KDevelop-Languages= * X-KDevelop-SupportedMimeTypes= * X-KDevelop-Interfaces= * X-KDevelop-IOptional= @@ -110,7 +110,7 @@ * in which case a plugin of the given name is required which implements the interface. * - X-KDevelop-IOptional is a list of extension interfaces that this * plugin will use if they are available (optional); - * - X-KDevelop-Language is the name of the language the plugin provides + * - X-KDevelop-Languages is a list of the names of the languages the plugin provides * support for (optional); * - X-KDevelop-SupportedMimeTypes is a list of mimetypes that the * language-parser in this plugin supports (optional); diff --git a/interfaces/kdevelopplugin.desktop b/interfaces/kdevelopplugin.desktop --- a/interfaces/kdevelopplugin.desktop +++ b/interfaces/kdevelopplugin.desktop @@ -83,9 +83,10 @@ [PropertyDef::X-KDevelop-SupportedMimeTypes] Type=QStringList -# optional, language supported by a language plugin -[PropertyDef::X-KDevelop-Language] -Type=QString +# optional, languages supported by a language plugin +# Example language names: "C", "C++", "Objective-C", "CMake" +[PropertyDef::X-KDevelop-Languages] +Type=QStringList # optional, defines whether the plugin can be disabled # by the user. Possible values are "AlwaysOn" and "UserSelectable". diff --git a/language/codegen/sourcefiletemplate.h b/language/codegen/sourcefiletemplate.h --- a/language/codegen/sourcefiletemplate.h +++ b/language/codegen/sourcefiletemplate.h @@ -51,8 +51,8 @@ * with forward slashes. The top-level category is usually the language followed by the framework. * @li @c Type An optional type, which then adds some more default wizard pages and configuration. * Currently supported are @c Class and @c Test. - * @li @c Language The @c X-KDevelop-Language id of a language plugin which is then asked for a custom - * createClassHelper. + * @li @c Language The @c X-KDevelop-Languages compatible id of a language plugin which is then asked + * for a custom @ref ICreateClassHelper object. * @li @c Files - List of files generated by this template. These are not actual file names, but names * of config groups describing those files. * @li @c OptionsFile (optional) - If the template uses custom configuration options, specify a path to @@ -280,7 +280,7 @@ QString type() const; /** - * aA optional @c X-KDevelop-Language by which a language plugin for this template can be found. + * An optional @c X-KDevelop-Languages compatible id by which a language plugin for this template can be found. */ QString languageName() const; diff --git a/plugins/patchreview/kdevpatchreview.json b/plugins/patchreview/kdevpatchreview.json --- a/plugins/patchreview/kdevpatchreview.json +++ b/plugins/patchreview/kdevpatchreview.json @@ -72,7 +72,7 @@ "org.kdevelop.IPatchReview", "ILanguageSupport" ], - "X-KDevelop-Language": "Diff", + "X-KDevelop-Languages": ["Diff"], "X-KDevelop-Mode": "GUI", "X-KDevelop-SupportedMimeTypes": [ "text/x-diff", diff --git a/shell/languagecontroller.cpp b/shell/languagecontroller.cpp --- a/shell/languagecontroller.cpp +++ b/shell/languagecontroller.cpp @@ -211,9 +211,27 @@ if(d->languages.contains(name)) return d->languages[name]; - QVariantMap constraints; - constraints.insert(QStringLiteral("X-KDevelop-Language"), name); - QList supports = Core::self()->pluginController()->allPluginsForExtension(KEY_ILanguageSupport(), constraints); + // temporary support for deprecated-in-5.1 "X-KDevelop-Language" as fallback + // remove in later version + const QString keys[2] = { + QStringLiteral("X-KDevelop-Languages"), + QStringLiteral("X-KDevelop-Language") + }; + QList supports; + for (const auto& key : keys) { + QVariantMap constraints; + constraints.insert(key, name); + supports = Core::self()->pluginController()->allPluginsForExtension(KEY_ILanguageSupport(), constraints); + if (key == keys[1]) { + for (auto support : supports) { + qWarning() << "Plugin" << Core::self()->pluginController()->pluginInfo(support).name() << " has deprecated (since 5.1) metadata key \"X-KDevelop-Language\", needs porting to: \"X-KDevelop-Languages\": ["<extension(); if(languageSupport) {