No more module services?

The method public static T getService(Module module, Class]]> serviceClass) has disappeared from the class ServiceManager in IDEA 8 OpenAPI. I copied the code from IDEA 7 API and got it working, but now I'm wondering whether the services API is going to become deprecated. We have a bunch of services defined as applicationService, projectService and moduleService in our plugin.xml. Those entries are always marked red in the plugin.xml but nevertheless they still seem to work. Is there some new way to define such kinds of components.

Cheers,
Robert

0

Hello Robert,

The method public static <T> T getService(Module module, Class<T>
serviceClass) has disappeared from the class ServiceManager in IDEA 8
OpenAPI. I copied the code from IDEA 7 API and got it working, but now
I'm wondering whether the services API is going to become deprecated.
We have a bunch of services defined as applicationService,
projectService and moduleService in our plugin.xml. Those entries are
always marked red in the plugin.xml but nevertheless they still seem
to work. Is there some new way to define such kinds of components.


Module services are still there and defined in the same way in plugin.xml.
To get an instance of a module service, use ModuleServiceManager.getService()
instead of ServiceManager.getService().

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

AFAIK registration has not changed

obtaining module services is now provided via

ModuleServiceManager.getService(module, MyModuleService.class)

see also http://www.jetbrains.net/confluence/display/IDEADEV/DianaPluginMigration+Guide

0

Thanks, I somehow overlooked that in the migration guide.

That looks really strange. I wonder why they didn't add ApplicationServiceManager and ProjectServiceManager and remove ServiceManager completely.

0

Hello Robert,

Thanks, I somehow overlooked that in the migration guide.


Most likely because it wasn't there when you looked. I just added this. :)

That looks really strange. I wonder why they didn't add
ApplicationServiceManager and ProjectServiceManager and remove
ServiceManager completely.


Removing ServiceManager completely would have broken a lot of stuff. ModuleServiceManager
was extracted out because the lowest level of the IDEA platform doesn't have
the concept of modules, but does have projects and project services.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Ah, so that's why I didn't see it ;)

BTW: Since you are updating the migration guide anyway, you probably could include sections about the new plugin.xml tags syntaxHighlighter, annotator, lang.elementManipulator and configurationType . I could have posted this somewhere else, but I was happy to find them in the example plugins as I needed them for the migration of Osmorc to IDEA 8 and to lazy to post about the fact that they are missing from the migration guide.

It's really a pity that @Override doesn't work for Interface methods in JDK 5. That would have made the migration much easier.

0

Hello Robert,

BTW: Since you are updating the migration guide anyway, you probably
could include sections about the new plugin.xml tags
syntaxHighlighter, annotator, lang.elementManipulator and
configurationType . I could have posted this somewhere else, but I was
happy to find them in the example plugins as I needed them for the
migration of Osmorc to IDEA 8 and to lazy to post about the fact that
they are missing from the migration guide.


There are actually at least a couple hundred new extension points in IDEA
8, so there's little chance of mentioning them all in the migration guide.
:) Some other document would be needed for that.

Some information on the new extension points is mentioned as "Language split
into extensions".

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

请先登录再写评论。