Skip to content

Commit cc244b3

Browse files
committed
Merge pull request #20 from Haacked/fixes-19
Remove Encouragement from Immediate Window
2 parents c45e6e1 + a339d3c commit cc244b3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

EncouragePackage/EncourageIntellisenseControllerProvider.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ public IIntellisenseController TryCreateIntellisenseController(ITextView textVie
2828
return null;
2929
}
3030

31+
// In general having an ITextDocument is sufficient to determine if a given ITextView is
32+
// back by an actual document. There are some windows though, like the Immediate Window,
33+
// which aren't documents that do still have a backing temporary file. These files are
34+
// uninteresting to Encourage because they are temporary files that exist as an
35+
// implementation detail
36+
//
37+
// The easiest way to filter for real documents is to check for the Document role
38+
if (!textView.Roles.Contains(PredefinedTextViewRoles.Document))
39+
{
40+
return null;
41+
}
42+
3143
return new EncourageIntellisenseController(textView, textDocument, this);
3244
}
3345
}

0 commit comments

Comments
 (0)