From cedcfd38c4d54f36f97b7d46a0a3d93058153968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Wed, 23 Jun 2021 10:43:25 +0200 Subject: [PATCH] plugin_services.md: use tabs --- topics/basics/plugin_structure/plugin_services.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/topics/basics/plugin_structure/plugin_services.md b/topics/basics/plugin_structure/plugin_services.md index 6b553996b..1fac41e01 100644 --- a/topics/basics/plugin_structure/plugin_services.md +++ b/topics/basics/plugin_structure/plugin_services.md @@ -77,7 +77,8 @@ To provide custom implementation for test/headless environment, specify `testSer Getting service doesn't need a read action and can be performed from any thread. If service is requested from several threads, it will be initialized in the first thread, and other threads will be blocked until service is fully initialized. -To retrieve a service in Java code: + + ```java MyApplicationService applicationService = ApplicationManager.getApplication().getService(MyApplicationService.class); @@ -85,13 +86,18 @@ MyApplicationService applicationService = ApplicationManager.getApplication().ge MyProjectService projectService = project.getService(MyProjectService.class) ``` -In Kotlin code, use convenience methods: + + + ```kotlin val applicationService = service() val projectService = project.service() ``` + + + ## Project Service Sample This minimal sample shows [Light Service](#light-services) `ProjectService` interacting with another project level service `AnotherService` (not shown here).