parent
e2703fe5f6
commit
8d6b86c76a
|
|
@ -8,5 +8,7 @@ namespace Microsoft.CodeAnalysis.Razor
|
||||||
public const string Name = "Razor";
|
public const string Name = "Razor";
|
||||||
|
|
||||||
public const string ContentType = "RazorCSharp";
|
public const string ContentType = "RazorCSharp";
|
||||||
|
|
||||||
|
public const string CoreContentType = "RazorCoreCSharp";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
}
|
}
|
||||||
|
|
||||||
var mappedPoints = projectionSnapshot.MapToSourceSnapshots(context.CompletionListSpan.Start);
|
var mappedPoints = projectionSnapshot.MapToSourceSnapshots(context.CompletionListSpan.Start);
|
||||||
var htmlSnapshotPoints = mappedPoints.Where(p => p.Snapshot.TextBuffer.ContentType.IsOfType(RazorLanguage.ContentType));
|
var htmlSnapshotPoints = mappedPoints.Where(p => p.Snapshot.TextBuffer.IsRazorBuffer());
|
||||||
|
|
||||||
if (!htmlSnapshotPoints.Any())
|
if (!htmlSnapshotPoints.Any())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ using Microsoft.VisualStudio.Utilities;
|
||||||
|
|
||||||
namespace Microsoft.VisualStudio.Editor.Razor
|
namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
[ContentType(RazorLanguage.ContentType)]
|
[ContentType(RazorLanguage.CoreContentType)]
|
||||||
[TextViewRole(PredefinedTextViewRoles.Document)]
|
[TextViewRole(PredefinedTextViewRoles.Document)]
|
||||||
[Export(typeof(ITextViewConnectionListener))]
|
[Export(typeof(ITextViewConnectionListener))]
|
||||||
internal class RazorTextViewConnectionListener : ITextViewConnectionListener
|
internal class RazorTextViewConnectionListener : ITextViewConnectionListener
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Microsoft.VisualStudio.Text
|
||||||
throw new ArgumentNullException(nameof(textBuffer));
|
throw new ArgumentNullException(nameof(textBuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
return textBuffer.ContentType.IsOfType(RazorLanguage.ContentType);
|
return textBuffer.ContentType.IsOfType(RazorLanguage.CoreContentType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
public class DefaultRazorDocumentManagerTest : ForegroundDispatcherTestBase
|
public class DefaultRazorDocumentManagerTest : ForegroundDispatcherTestBase
|
||||||
{
|
{
|
||||||
private IContentType RazorContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(RazorLanguage.ContentType) == true);
|
private IContentType RazorCoreContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(RazorLanguage.CoreContentType) == true);
|
||||||
|
|
||||||
private IContentType NonRazorContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(It.IsAny<string>()) == false);
|
private IContentType NonRazorCoreContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(It.IsAny<string>()) == false);
|
||||||
|
|
||||||
private string FilePath => "C:/Some/Path/TestDocumentTracker.cshtml";
|
private string FilePath => "C:/Some/Path/TestDocumentTracker.cshtml";
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
var textView = Mock.Of<ITextView>();
|
var textView = Mock.Of<ITextView>();
|
||||||
var buffers = new Collection<ITextBuffer>()
|
var buffers = new Collection<ITextBuffer>()
|
||||||
{
|
{
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
|
|
@ -65,7 +65,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
var textView = Mock.Of<ITextView>();
|
var textView = Mock.Of<ITextView>();
|
||||||
var buffers = new Collection<ITextBuffer>()
|
var buffers = new Collection<ITextBuffer>()
|
||||||
{
|
{
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
|
|
@ -79,7 +79,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
var textView = Mock.Of<ITextView>();
|
var textView = Mock.Of<ITextView>();
|
||||||
var buffers = new Collection<ITextBuffer>()
|
var buffers = new Collection<ITextBuffer>()
|
||||||
{
|
{
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
};
|
};
|
||||||
var documentTracker = new DefaultVisualStudioDocumentTracker(Dispatcher, FilePath, ProjectPath, ProjectManager, EditorSettingsManager, Workspace, buffers[0], ImportDocumentManager) as VisualStudioDocumentTracker;
|
var documentTracker = new DefaultVisualStudioDocumentTracker(Dispatcher, FilePath, ProjectPath, ProjectManager, EditorSettingsManager, Workspace, buffers[0], ImportDocumentManager) as VisualStudioDocumentTracker;
|
||||||
var editorFactoryService = Mock.Of<RazorEditorFactoryService>(factoryService => factoryService.TryGetDocumentTracker(It.IsAny<ITextBuffer>(), out documentTracker) == true);
|
var editorFactoryService = Mock.Of<RazorEditorFactoryService>(factoryService => factoryService.TryGetDocumentTracker(It.IsAny<ITextBuffer>(), out documentTracker) == true);
|
||||||
|
|
@ -99,8 +99,8 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
var textView = Mock.Of<ITextView>();
|
var textView = Mock.Of<ITextView>();
|
||||||
var buffers = new Collection<ITextBuffer>()
|
var buffers = new Collection<ITextBuffer>()
|
||||||
{
|
{
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
};
|
};
|
||||||
var documentTracker = new DefaultVisualStudioDocumentTracker(Dispatcher, FilePath, ProjectPath, ProjectManager, EditorSettingsManager, Workspace, buffers[0], ImportDocumentManager) as VisualStudioDocumentTracker;
|
var documentTracker = new DefaultVisualStudioDocumentTracker(Dispatcher, FilePath, ProjectPath, ProjectManager, EditorSettingsManager, Workspace, buffers[0], ImportDocumentManager) as VisualStudioDocumentTracker;
|
||||||
var editorFactoryService = Mock.Of<RazorEditorFactoryService>(f => f.TryGetDocumentTracker(It.IsAny<ITextBuffer>(), out documentTracker) == true);
|
var editorFactoryService = Mock.Of<RazorEditorFactoryService>(f => f.TryGetDocumentTracker(It.IsAny<ITextBuffer>(), out documentTracker) == true);
|
||||||
|
|
@ -124,7 +124,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
var textView = Mock.Of<ITextView>();
|
var textView = Mock.Of<ITextView>();
|
||||||
var buffers = new Collection<ITextBuffer>()
|
var buffers = new Collection<ITextBuffer>()
|
||||||
{
|
{
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -142,7 +142,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
var textView = Mock.Of<ITextView>();
|
var textView = Mock.Of<ITextView>();
|
||||||
var buffers = new Collection<ITextBuffer>()
|
var buffers = new Collection<ITextBuffer>()
|
||||||
{
|
{
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -160,8 +160,8 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
var textView2 = Mock.Of<ITextView>();
|
var textView2 = Mock.Of<ITextView>();
|
||||||
var buffers = new Collection<ITextBuffer>()
|
var buffers = new Collection<ITextBuffer>()
|
||||||
{
|
{
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Preload the buffer's properties with a tracker, so it's like we've already tracked this one.
|
// Preload the buffer's properties with a tracker, so it's like we've already tracked this one.
|
||||||
|
|
@ -197,8 +197,8 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
var textView2 = Mock.Of<ITextView>();
|
var textView2 = Mock.Of<ITextView>();
|
||||||
var buffers = new Collection<ITextBuffer>()
|
var buffers = new Collection<ITextBuffer>()
|
||||||
{
|
{
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorContentType && b.Properties == new PropertyCollection()),
|
Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorCoreContentType && b.Properties == new PropertyCollection()),
|
||||||
};
|
};
|
||||||
var documentTracker = new DefaultVisualStudioDocumentTracker(Dispatcher, FilePath, ProjectPath, ProjectManager, EditorSettingsManager, Workspace, buffers[0], ImportDocumentManager);
|
var documentTracker = new DefaultVisualStudioDocumentTracker(Dispatcher, FilePath, ProjectPath, ProjectManager, EditorSettingsManager, Workspace, buffers[0], ImportDocumentManager);
|
||||||
buffers[0].Properties.AddProperty(typeof(VisualStudioDocumentTracker), documentTracker);
|
buffers[0].Properties.AddProperty(typeof(VisualStudioDocumentTracker), documentTracker);
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
public class DefaultRazorEditorFactoryServiceTest
|
public class DefaultRazorEditorFactoryServiceTest
|
||||||
{
|
{
|
||||||
private IContentType RazorContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(RazorLanguage.ContentType) == true);
|
private IContentType RazorCoreContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(RazorLanguage.CoreContentType) == true);
|
||||||
|
|
||||||
private IContentType NonRazorContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(It.IsAny<string>()) == false);
|
private IContentType NonRazorCoreContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(It.IsAny<string>()) == false);
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void TryGetDocumentTracker_ForRazorTextBuffer_ReturnsTrue()
|
public void TryGetDocumentTracker_ForRazorTextBuffer_ReturnsTrue()
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
// Arrange
|
// Arrange
|
||||||
var expectedDocumentTracker = Mock.Of<VisualStudioDocumentTracker>();
|
var expectedDocumentTracker = Mock.Of<VisualStudioDocumentTracker>();
|
||||||
var factoryService = CreateFactoryService(expectedDocumentTracker);
|
var factoryService = CreateFactoryService(expectedDocumentTracker);
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = factoryService.TryGetDocumentTracker(textBuffer, out var documentTracker);
|
var result = factoryService.TryGetDocumentTracker(textBuffer, out var documentTracker);
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var factoryService = CreateFactoryService();
|
var factoryService = CreateFactoryService();
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = factoryService.TryGetDocumentTracker(textBuffer, out var documentTracker);
|
var result = factoryService.TryGetDocumentTracker(textBuffer, out var documentTracker);
|
||||||
|
|
@ -52,7 +52,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
// Arrange
|
// Arrange
|
||||||
var expectedDocumentTracker = Mock.Of<VisualStudioDocumentTracker>();
|
var expectedDocumentTracker = Mock.Of<VisualStudioDocumentTracker>();
|
||||||
var factoryService = CreateFactoryService(expectedDocumentTracker);
|
var factoryService = CreateFactoryService(expectedDocumentTracker);
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
factoryService.EnsureTextBufferInitialized(textBuffer);
|
factoryService.EnsureTextBufferInitialized(textBuffer);
|
||||||
|
|
@ -67,7 +67,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var factoryService = CreateFactoryService();
|
var factoryService = CreateFactoryService();
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
factoryService.EnsureTextBufferInitialized(textBuffer);
|
factoryService.EnsureTextBufferInitialized(textBuffer);
|
||||||
var expectedDocumentTracker = textBuffer.Properties[typeof(VisualStudioDocumentTracker)];
|
var expectedDocumentTracker = textBuffer.Properties[typeof(VisualStudioDocumentTracker)];
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
// Arrange
|
// Arrange
|
||||||
var expectedParser = Mock.Of<VisualStudioRazorParser>();
|
var expectedParser = Mock.Of<VisualStudioRazorParser>();
|
||||||
var factoryService = CreateFactoryService(parser: expectedParser);
|
var factoryService = CreateFactoryService(parser: expectedParser);
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = factoryService.TryGetParser(textBuffer, out var parser);
|
var result = factoryService.TryGetParser(textBuffer, out var parser);
|
||||||
|
|
@ -103,7 +103,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var factoryService = CreateFactoryService();
|
var factoryService = CreateFactoryService();
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = factoryService.TryGetParser(textBuffer, out var parser);
|
var result = factoryService.TryGetParser(textBuffer, out var parser);
|
||||||
|
|
@ -119,7 +119,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
// Arrange
|
// Arrange
|
||||||
var expectedParser = Mock.Of<VisualStudioRazorParser>();
|
var expectedParser = Mock.Of<VisualStudioRazorParser>();
|
||||||
var factoryService = CreateFactoryService(parser: expectedParser);
|
var factoryService = CreateFactoryService(parser: expectedParser);
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
factoryService.EnsureTextBufferInitialized(textBuffer);
|
factoryService.EnsureTextBufferInitialized(textBuffer);
|
||||||
|
|
@ -134,7 +134,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var factoryService = CreateFactoryService();
|
var factoryService = CreateFactoryService();
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
factoryService.EnsureTextBufferInitialized(textBuffer);
|
factoryService.EnsureTextBufferInitialized(textBuffer);
|
||||||
var expectedParser = textBuffer.Properties[typeof(VisualStudioRazorParser)];
|
var expectedParser = textBuffer.Properties[typeof(VisualStudioRazorParser)];
|
||||||
|
|
||||||
|
|
@ -155,7 +155,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
// Arrange
|
// Arrange
|
||||||
var expectedSmartIndenter = Mock.Of<BraceSmartIndenter>();
|
var expectedSmartIndenter = Mock.Of<BraceSmartIndenter>();
|
||||||
var factoryService = CreateFactoryService(smartIndenter: expectedSmartIndenter);
|
var factoryService = CreateFactoryService(smartIndenter: expectedSmartIndenter);
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = factoryService.TryGetSmartIndenter(textBuffer, out var smartIndenter);
|
var result = factoryService.TryGetSmartIndenter(textBuffer, out var smartIndenter);
|
||||||
|
|
@ -170,7 +170,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var factoryService = CreateFactoryService();
|
var factoryService = CreateFactoryService();
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == NonRazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = factoryService.TryGetSmartIndenter(textBuffer, out var smartIndenter);
|
var result = factoryService.TryGetSmartIndenter(textBuffer, out var smartIndenter);
|
||||||
|
|
@ -186,7 +186,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
// Arrange
|
// Arrange
|
||||||
var expectedSmartIndenter = Mock.Of<BraceSmartIndenter>();
|
var expectedSmartIndenter = Mock.Of<BraceSmartIndenter>();
|
||||||
var factoryService = CreateFactoryService(smartIndenter: expectedSmartIndenter);
|
var factoryService = CreateFactoryService(smartIndenter: expectedSmartIndenter);
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
factoryService.EnsureTextBufferInitialized(textBuffer);
|
factoryService.EnsureTextBufferInitialized(textBuffer);
|
||||||
|
|
@ -201,7 +201,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var factoryService = CreateFactoryService();
|
var factoryService = CreateFactoryService();
|
||||||
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType && b.Properties == new PropertyCollection());
|
var textBuffer = Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType && b.Properties == new PropertyCollection());
|
||||||
factoryService.EnsureTextBufferInitialized(textBuffer);
|
factoryService.EnsureTextBufferInitialized(textBuffer);
|
||||||
var expectedSmartIndenter = textBuffer.Properties[typeof(BraceSmartIndenter)];
|
var expectedSmartIndenter = textBuffer.Properties[typeof(BraceSmartIndenter)];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
|
|
||||||
var contentType = new Mock<IContentType>();
|
var contentType = new Mock<IContentType>();
|
||||||
contentType.Setup(type => type.IsOfType(It.IsAny<string>()))
|
contentType.Setup(type => type.IsOfType(It.IsAny<string>()))
|
||||||
.Returns<string>(val => val == RazorLanguage.ContentType);
|
.Returns<string>(val => val == RazorLanguage.CoreContentType);
|
||||||
textBuffer.Setup(buffer => buffer.ContentType)
|
textBuffer.Setup(buffer => buffer.ContentType)
|
||||||
.Returns(contentType.Object);
|
.Returns(contentType.Object);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@ namespace Microsoft.VisualStudio.Editor.Razor
|
||||||
{
|
{
|
||||||
public class DefaultVisualStudioDocumentTrackerTest : ForegroundDispatcherTestBase
|
public class DefaultVisualStudioDocumentTrackerTest : ForegroundDispatcherTestBase
|
||||||
{
|
{
|
||||||
private IContentType RazorContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(RazorLanguage.ContentType) == true);
|
private IContentType RazorCoreContentType { get; } = Mock.Of<IContentType>(c => c.IsOfType(RazorLanguage.CoreContentType) == true);
|
||||||
|
|
||||||
private ITextBuffer TextBuffer => Mock.Of<ITextBuffer>(b => b.ContentType == RazorContentType);
|
private ITextBuffer TextBuffer => Mock.Of<ITextBuffer>(b => b.ContentType == RazorCoreContentType);
|
||||||
|
|
||||||
private string FilePath => "C:/Some/Path/TestDocumentTracker.cshtml";
|
private string FilePath => "C:/Some/Path/TestDocumentTracker.cshtml";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue