mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2024-10-27 20:44:05 +00:00
Use Kotlin extension function to retrieve service
This commit is contained in:
parent
624c6950be
commit
e3e031bd96
@ -14,6 +14,7 @@
|
||||
- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.1`
|
||||
- GitHub Actions - `gradleValidation` update to `gradle/wrapper-validation-action@v1.0.3`
|
||||
- GitHub Actions - `releaseDraft` update to `actions/download-artifact@v2`
|
||||
- Use [Kotlin extension function](https://jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_services.html?search=servic#retrieving-a-service) to retrieve the `MyProjectService` in the `MyProjectManagerListener`
|
||||
|
||||
### Removed
|
||||
- Remove Third-party IntelliJ Plugin Verifier GitHub Action
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.jetbrains.plugins.template.listeners
|
||||
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.project.ProjectManagerListener
|
||||
import org.jetbrains.plugins.template.services.MyProjectService
|
||||
@ -7,6 +8,6 @@ import org.jetbrains.plugins.template.services.MyProjectService
|
||||
internal class MyProjectManagerListener : ProjectManagerListener {
|
||||
|
||||
override fun projectOpened(project: Project) {
|
||||
project.getService(MyProjectService::class.java)
|
||||
project.service<MyProjectService>()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user