Skip to content

Commit

Permalink
Merge pull request #20 from Haacked/fixes-19
Browse files Browse the repository at this point in the history
Remove Encouragement from Immediate Window
  • Loading branch information
haacked committed Jul 18, 2014
2 parents c45e6e1 + a339d3c commit cc244b3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions EncouragePackage/EncourageIntellisenseControllerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ public IIntellisenseController TryCreateIntellisenseController(ITextView textVie
return null;
}

// In general having an ITextDocument is sufficient to determine if a given ITextView is
// back by an actual document. There are some windows though, like the Immediate Window,
// which aren't documents that do still have a backing temporary file. These files are
// uninteresting to Encourage because they are temporary files that exist as an
// implementation detail
//
// The easiest way to filter for real documents is to check for the Document role
if (!textView.Roles.Contains(PredefinedTextViewRoles.Document))
{
return null;
}

return new EncourageIntellisenseController(textView, textDocument, this);
}
}
Expand Down

0 comments on commit cc244b3

Please sign in to comment.