Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349852 - Probable Bug with the orion.edit.highlighter service
Summary: Probable Bug with the orion.edit.highlighter service
Status: RESOLVED WORKSFORME
Alias: None
Product: Orion
Classification: ECD
Component: Editor (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-20 12:42 EDT by Pradyut Sarma CLA
Modified: 2014-03-03 14:38 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pradyut Sarma CLA 2011-06-20 12:42:57 EDT
Build Identifier: M8

Hi,

I tried contributing to the service "orion.edit.highlighter" for my own file type as follows,

     var serviceProperties = orion.editor.MdtGrammar;
     provider.registerServiceProvider("orion.edit.highlighter", {}, serviceProperties);
     provider.connect();

I have modeled the class "MdtGrammar" on the HTMLGrammar class contributed by you.
But somehow the grammar wasn't picked up. I went ahead and checked out the js file setup.js within org.eclipse.orion.client.core_0.2.0.v20110604-2125\web\edit where you read the service references for the above extension point. Below is the code snippet,

	var syntaxHighlightProviders = serviceRegistry.getServiceReferences("orion.edit.highlighter");

where the array, syntaxHighlightProviders  should contain the service reference that I have contributed. 
The issue here is, the size of this array is 1 and contains only the HTML contribution and my reference is not being picked up. 
Is there any problem with the way I may have contributed. BTW, my plugin installed successfully.

Thanks and Regards,
Pradyut.

Reproducible: Always

Steps to Reproduce:
Check "Details" section
Comment 1 Boris Bokowski CLA 2011-06-20 13:25:44 EDT
If you go to the Plugins page, do you see your plugin listed there? If you drill down, does the tree contain all the information that you would expect? Anything misspelled for example?
Comment 2 Pradyut Sarma CLA 2011-06-21 03:17:15 EDT
Hey Boris,

Thanks for the tip. I should have thought about looking into the Plugin Registry myself. I had written one plugin which contributed to two extension points, one for the editor type to "orion.navigate.openWith" and the other to "orion.edit.highlighter" for the grammar. On analyzing the registry, I could find only one service and that was of the openWith contribution. The one for the "highlighter" did not register itself.

What I did next was to, put the contribution to the "highlighter" service into a separate plugin and install it separately and it worked.......which leads me to two inferences.

1) If I am registering to two services from the same plugin, and just one service is successfully registered, the user is still not informed about the failure of the second registration. The message displayed is "Plugins Installed Successfully".

2) I transfer both contributions to two different plugins and it registered successfully. I am still not sure why it didn't work as part of the same plugin.

Best Regards,
Pradyut.
Comment 3 Boris Bokowski CLA 2011-06-21 09:36:10 EDT
Just yesterday, we've added a "Reload" action on the plugins page. I think this would have helped in your case.
Comment 4 Silenio Quarti CLA 2014-03-03 14:38:29 EST
I am closing this one because it is quite old and I believe this issue has been solved. Please reopen if you still have problems.