diff --git a/src/Workspaces/Core/Portable/LinkedFileDiffMerging/DefaultDocumentTextDifferencingService.cs b/src/Workspaces/Core/Portable/LinkedFileDiffMerging/DefaultDocumentTextDifferencingService.cs index 1301d5019308..4c37b35d0e15 100644 --- a/src/Workspaces/Core/Portable/LinkedFileDiffMerging/DefaultDocumentTextDifferencingService.cs +++ b/src/Workspaces/Core/Portable/LinkedFileDiffMerging/DefaultDocumentTextDifferencingService.cs @@ -1,12 +1,15 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; +using System.Composition; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis { + [ExportWorkspaceService(typeof(IDocumentTextDifferencingService), ServiceLayer.Default), Shared] internal class DefaultDocumentTextDifferencingService : IDocumentTextDifferencingService { public async Task> GetTextChangesAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken) diff --git a/src/Workspaces/CoreTest/WorkspaceTests/AdhocWorkspaceTests.cs b/src/Workspaces/CoreTest/WorkspaceTests/AdhocWorkspaceTests.cs index 5ac2d7a22277..d821ec316672 100644 --- a/src/Workspaces/CoreTest/WorkspaceTests/AdhocWorkspaceTests.cs +++ b/src/Workspaces/CoreTest/WorkspaceTests/AdhocWorkspaceTests.cs @@ -661,5 +661,16 @@ public void TestChangeDocumentInfo_TryApplyChanges() Assert.Equal(newPath, appliedDoc.FilePath); } } + + [Fact, Trait(Traits.Feature, Traits.Features.Workspace)] + public void TestDefaultDocumentTextDifferencingService() + { + using (var ws = new AdhocWorkspace()) + { + var service = ws.Services.GetService(); + Assert.NotNull(service); + Assert.Equal(service.GetType(), typeof(DefaultDocumentTextDifferencingService)); + } + } } }