@com.intellij.openapi.components.Service
注解标记为轻量服务,而不是在 plugin.xml
中注册为服务的类
不打算重写的服务无需在 plugin.xml
文件中注册。
可以改用 @Service
注解来注解服务类。 对于项目级服务,请指定 @Service(Service.Level.PROJECT)
。
要求:
final
。serviceInterface
。com.intellij.openapi.components.PersistentStateComponent
,则必须禁用漫游 (roamingType = RoamingType.DISABLED
)。
os
、client
、overrides
、id
、preload
、configurationSchemaKey
。如需了解详情,请参阅 IntelliJ 平台插件 SDK 文档中的服务。
另请参阅 Plugin DevKit | 插件描述符 | 服务可被转换为轻量服务
检查。
2023.2 最新变化