Enables the Razor Document Tracker
This enables the tracking of events that change the 'razor' state of a document that's open in the editor. Also fixed a crash that can occur when creating a new project with the Razor Info window open.
This commit is contained in:
parent
4fcad1548e
commit
5161ebaf8a
|
|
@ -16,8 +16,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
|
||||||
{
|
{
|
||||||
[ContentType(RazorLanguage.ContentType)]
|
[ContentType(RazorLanguage.ContentType)]
|
||||||
[TextViewRole(PredefinedTextViewRoles.Editable)]
|
[TextViewRole(PredefinedTextViewRoles.Editable)]
|
||||||
//[Export(typeof(IWpfTextViewConnectionListener))] - we're not exporting this interface because we only want it to be hooked up
|
[Export(typeof(IWpfTextViewConnectionListener))]
|
||||||
// in developer mode.
|
|
||||||
[Export(typeof(TextViewRazorDocumentTrackerService))]
|
[Export(typeof(TextViewRazorDocumentTrackerService))]
|
||||||
internal class DefaultTextViewRazorDocumentTrackerService : TextViewRazorDocumentTrackerService, IWpfTextViewConnectionListener
|
internal class DefaultTextViewRazorDocumentTrackerService : TextViewRazorDocumentTrackerService, IWpfTextViewConnectionListener
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,10 @@ namespace Microsoft.VisualStudio.RazorExtension.DocumentInfo
|
||||||
private void OnBeforeDocumentWindowShow(IVsWindowFrame frame)
|
private void OnBeforeDocumentWindowShow(IVsWindowFrame frame)
|
||||||
{
|
{
|
||||||
var vsTextView = VsShellUtilities.GetTextView(frame);
|
var vsTextView = VsShellUtilities.GetTextView(frame);
|
||||||
|
if (vsTextView == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var textView = _adapterFactory.GetWpfTextView(vsTextView);
|
var textView = _adapterFactory.GetWpfTextView(vsTextView);
|
||||||
if (textView != null && textView != _textView)
|
if (textView != null && textView != _textView)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue