I had some trouble to get the new CollapsedRegionQuickInfoProvider working alongside my existing QuickInfoProvider.
My quick info service (similar to CustomQuickInfoProvider on your sample) was displaying errors, info on Identifiers, etc.
Then, when I registered the service to the new collapsed region quick info provider:
// In MySyntaxLanguage method
this.RegisterService(new MyQuickInfoProvider());
this.RegisterService(new CollapsedRegionQuickInfoProvider());
MyQuickInfoProvider stopped being called. If I switched the previous lines, only the last one would be called. Then I realised I had to merge both providers.
I got it to work with the following construct (only the relevant lines are included):
class MyQuickInfoProvider : QuickInfoProviderBase
{
CollapsedRegionQuickInfoProvider foldingProvider =
new CollapsedRegionQuickInfoProvider();
public override object GetContext(IHitTestResult hitTestResult)
{
if (hitTestResult.Type == HitTestResultType.ViewTextAreaOverCharacter)
... // Gets context for my word related quick infos
else if (hitTestResult.Type == HitTestResultType.ViewTextAreaOverIntraTextSpacer)
return foldingProvider.GetContext(hitTestResult); // Calls the folding provider
else return null;
}
...
}
However, this would only work if I keep both calls to RegisterService(), and only when they are in the opposite order:
this.RegisterService(new CollapsedRegionQuickInfoProvider());
this.RegisterService(new MyQuickInfoProvider());
So, to get to the point, this seems a convoluted way to get it working. And because I can't see the source for your CollapsedRegionQuickInfoProvider class, it is hard to figure out what's going on inside.
Am I missing something obvious?
My quick info service (similar to CustomQuickInfoProvider on your sample) was displaying errors, info on Identifiers, etc.
Then, when I registered the service to the new collapsed region quick info provider:
// In MySyntaxLanguage method
this.RegisterService(new MyQuickInfoProvider());
this.RegisterService(new CollapsedRegionQuickInfoProvider());
MyQuickInfoProvider stopped being called. If I switched the previous lines, only the last one would be called. Then I realised I had to merge both providers.
I got it to work with the following construct (only the relevant lines are included):
class MyQuickInfoProvider : QuickInfoProviderBase
{
CollapsedRegionQuickInfoProvider foldingProvider =
new CollapsedRegionQuickInfoProvider();
public override object GetContext(IHitTestResult hitTestResult)
{
if (hitTestResult.Type == HitTestResultType.ViewTextAreaOverCharacter)
... // Gets context for my word related quick infos
else if (hitTestResult.Type == HitTestResultType.ViewTextAreaOverIntraTextSpacer)
return foldingProvider.GetContext(hitTestResult); // Calls the folding provider
else return null;
}
...
}
However, this would only work if I keep both calls to RegisterService(), and only when they are in the opposite order:
this.RegisterService(new CollapsedRegionQuickInfoProvider());
this.RegisterService(new MyQuickInfoProvider());
So, to get to the point, this seems a convoluted way to get it working. And because I can't see the source for your CollapsedRegionQuickInfoProvider class, it is hard to figure out what's going on inside.
Am I missing something obvious?