using two QuickInfoProviders

SyntaxEditor for WPF Forum

Posted 14 years ago by Martin - Blaise - Statistics Netherlands
Version: 9.2.0514
Avatar
i made a Quickinforprovider (for keywords) that worked fine.
Now i added a CollapsedRegionQuickInfoProvider too to my syntaxlanguage. When text is collapsed (using Automatic outlining) it shows the collapsed text.

When i add the CollapsedRegionQuickInfoProvider my first Quickinfoprovider doesnt work. Has this to do with orderings or contexts? How can i use two QuickInfoProviders in one language?

Regards
Martin

Comments (6)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
There was a bug with using two of them. We fixed it in yesterday's build 515 though.


Actipro Software Support

Posted 13 years ago by Martin - Blaise - Statistics Netherlands
Avatar
I am trying to activate both, but this seems still or again not possible. Maybe the problem came back?;)

Now i have two QuickInfoProviderBase active, but it seems only one is working. Or is there something wrong with my Ordering?

public BlaiseCollapsedRegionQuickInfoProvider() : base("BlaiseCollapsedRegion", new Ordering("BlaiseSquiggleTag", OrderPlacement.After)) { }

public BlaiseQuickInfoProvider() : base("BlaiseQuickInfoProvider") { }

[Modified at 02/10/2011 02:45 AM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Martin,

Is "BlaiseSquiggleTag" a quick info provider? If not, having it there probably isn't doing anything. Which one of these should have priority and show if they overlap?

If you think there is a bug, please make a new simple sample project that shows the issue and email that over to us. We're hoping to get a maintenance release out in the next several days so if there is a bug we'd like to get it fixed for that.


Actipro Software Support

Posted 13 years ago by Martin - Blaise - Statistics Netherlands
Avatar
i removed the ordering but that didnt help.. Tomorrow i will look into again.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Martin,

Thanks for the sample, it turns out you were registering the two quick info provider services under the same type key (IQuickInfoProvider) like this:
this.RegisterService<IQuickInfoProvider>(new BlaiseCollapsedRegionQuickInfoProvider());
this.RegisterService<IQuickInfoProvider>(new BlaiseQuickInfoProvider());
So your first BlaiseCollapsedRegionQuickInfoProvider service was registered as IQuickInfoProvider. Then your second BlaiseQuickInfoProvider effectively removes the first service since it's also registered as IQuickInfoProvider.

For provider services and event sinks, you want to just allow them to register as whatever type they are, like this:
this.RegisterService(new BlaiseCollapsedRegionQuickInfoProvider());
this.RegisterService(new BlaiseQuickInfoProvider());
Note this is in the docs for provider services in the Service Locator Architecture topic:
"But be careful to not register more than one service with the same Type key, or else the existing service that with Type key will be removed."

But it's certainly easy to miss that with all the documentation info on services. :) At least this is an easy fix and everything works if you change it like that.


Actipro Software Support

Posted 13 years ago by Martin - Blaise - Statistics Netherlands
Avatar
Geez, some days i am just asleep:)

it works now (ofcourse you would say;))

Thanks you guys (and girls?) for waking me up !

Met vriendelijke groeten

Martin
The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.