| 24 | } |
| 25 | |
| 26 | bool PythonPlugin::start() |
| 27 | { |
| 28 | qInfo() << __FUNCTION__; |
| 29 | auto &ctx = dpfInstance.serviceContext(); |
| 30 | LanguageService *languageService = ctx.service<LanguageService>(LanguageService::name()); |
| 31 | if (languageService) { |
| 32 | QString errorString; |
| 33 | bool ret = languageService->regClass<PythonGenerator>(PythonGenerator::toolKitName(), &errorString); |
| 34 | if (!ret) { |
| 35 | qCritical() << errorString; |
| 36 | } else { |
| 37 | ret = languageService->create<PythonGenerator>(PythonGenerator::toolKitName(), &errorString); |
| 38 | if (!ret) { |
| 39 | qCritical() << errorString; |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | ProjectService *projectService = ctx.service<ProjectService>(ProjectService::name()); |
| 45 | if (projectService) { |
| 46 | QString errorString; |
| 47 | projectService->implGenerator<PythonProjectGenerator>(PythonProjectGenerator::toolKitName(), &errorString); |
| 48 | } |
| 49 | |
| 50 | OptionService *optionService = ctx.service<OptionService>(OptionService::name()); |
| 51 | if (!optionService) { |
| 52 | qCritical() << "Failed, not found OptionPython service!"; |
| 53 | abort(); |
| 54 | } |
| 55 | optionService->implGenerator<OptionPythonGenerator>(option::GROUP_LANGUAGE, OptionPythonGenerator::kitName()); |
| 56 | |
| 57 | registEditorService(); |
| 58 | registerPIPInstaller(); |
| 59 | return true; |
| 60 | } |
| 61 | |
| 62 | dpf::Plugin::ShutdownFlag PythonPlugin::stop() |
| 63 | { |
no test coverage detected