Skip to content

Commit

Permalink
Remove javascript signatures from encouragement
Browse files Browse the repository at this point in the history
The Javascript IDE implementation has a bug where by it will insert its
signature help into any ISignatureHelpSession that is started.  This
includes the session that is started by the Enouragement extension.
This causes encouragement tips to be intermixed with javascript
signatures

Due to the implementation of the Javascript provider the only suitable
short term fix is to a) run after them and b) just remove their
signatures from our session.

This fixes #16

As a consequence it also fixes #1 as well.
  • Loading branch information
jaredpar committed Jul 11, 2014
1 parent d252d23 commit 7b1ae50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions EncouragePackage/EncourageSignatureHelpSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ public void AugmentSignatureHelpSession(ISignatureHelpSession session, IList<ISi
return;
}

// At the moment there is a bug in the javascript provider which causes it to
// repeatedly insert the same Signature values into an ISignatureHelpSession
// instance. There is no way, other than reflection, for us to prevent this
// from happening. Instead we just ensure that our provider runs after
// Javascript and then remove the values they add here
signatures.Clear();

// Map the trigger point down to our buffer.
var subjectTriggerPoint = session.GetTriggerPoint(subjectBuffer.CurrentSnapshot);
if (!subjectTriggerPoint.HasValue)
Expand Down
1 change: 1 addition & 0 deletions EncouragePackage/EncourageSignatureHelpSourceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Haack.Encourage
[Export(typeof(ISignatureHelpSourceProvider))]
[Name("ToolTip SignatureHelp Source")]
[Order(Before = "Default Signature Help Presenter")]
[Order(After = "JavaScript Signature Help source")]
[ContentType("text")]
internal class EncourageSignatureHelpSourceProvider : ISignatureHelpSourceProvider
{
Expand Down

0 comments on commit 7b1ae50

Please sign in to comment.