diff --git a/src/VisualStudio/CSharp/Impl/CSharpVisualStudio.csproj b/src/VisualStudio/CSharp/Impl/CSharpVisualStudio.csproj
index d2a0f58e2ebb7a26fd6cc19ce2c219f05cf2ef54..82f22e10523cf00b2066de24573dfdf9279b770d 100644
--- a/src/VisualStudio/CSharp/Impl/CSharpVisualStudio.csproj
+++ b/src/VisualStudio/CSharp/Impl/CSharpVisualStudio.csproj
@@ -81,18 +81,40 @@
true
- false
- false
- false
- false
- false
- false
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
- false
- false
- false
- false
- false
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
True
@@ -102,14 +124,30 @@
True
- false
- false
- false
- false
- false
- false
- false
- false
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
@@ -159,6 +197,8 @@
+
+
@@ -284,4 +324,4 @@
-
+
\ No newline at end of file
diff --git a/src/VisualStudio/CSharp/Impl/ObjectBrowser/CSharpLibraryService.cs b/src/VisualStudio/CSharp/Impl/ObjectBrowser/CSharpLibraryService.cs
new file mode 100644
index 0000000000000000000000000000000000000000..815c19193d15a9a171323ac4a8a9b8112df31fa6
--- /dev/null
+++ b/src/VisualStudio/CSharp/Impl/ObjectBrowser/CSharpLibraryService.cs
@@ -0,0 +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 Microsoft.VisualStudio.LanguageServices.Implementation.Library;
+using Microsoft.VisualStudio.Shell.Interop;
+
+namespace Microsoft.VisualStudio.LanguageServices.CSharp.ObjectBrowser
+{
+ internal class CSharpLibraryService : AbstractLibraryService
+ {
+ public CSharpLibraryService()
+ : base(Guids.CSharpLibraryId, __SymbolToolLanguage.SymbolToolLanguage_CSharp)
+ {
+ }
+ }
+}
diff --git a/src/VisualStudio/CSharp/Impl/ObjectBrowser/CSharpLibraryServiceFactory.cs b/src/VisualStudio/CSharp/Impl/ObjectBrowser/CSharpLibraryServiceFactory.cs
new file mode 100644
index 0000000000000000000000000000000000000000..8893ae3593f3722288957459c3eb2e61ee72b117
--- /dev/null
+++ b/src/VisualStudio/CSharp/Impl/ObjectBrowser/CSharpLibraryServiceFactory.cs
@@ -0,0 +1,19 @@
+// 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.Composition;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.VisualStudio.LanguageServices.Implementation.Library;
+
+namespace Microsoft.VisualStudio.LanguageServices.CSharp.ObjectBrowser
+{
+ [ExportLanguageServiceFactory(typeof(ILibraryService), LanguageNames.CSharp), Shared]
+ internal class CSharpLibraryServiceFactory : ILanguageServiceFactory
+ {
+ public ILanguageService CreateLanguageService(HostLanguageServices languageServices)
+ {
+ return new CSharpLibraryService();
+ }
+ }
+}
diff --git a/src/VisualStudio/Core/Def/Implementation/Library/AbstractLibraryService.cs b/src/VisualStudio/Core/Def/Implementation/Library/AbstractLibraryService.cs
new file mode 100644
index 0000000000000000000000000000000000000000..7d8dabb0acb566c6e92ed0f114f40f9e6dba6ce0
--- /dev/null
+++ b/src/VisualStudio/Core/Def/Implementation/Library/AbstractLibraryService.cs
@@ -0,0 +1,24 @@
+// 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;
+using Microsoft.VisualStudio.LanguageServices.Implementation.Library.VsNavInfo;
+using Microsoft.VisualStudio.Shell.Interop;
+
+namespace Microsoft.VisualStudio.LanguageServices.Implementation.Library
+{
+ internal abstract class AbstractLibraryService : ILibraryService
+ {
+ public Guid LibraryId { get; }
+ public __SymbolToolLanguage PreferredLanguage { get; }
+
+ public NavInfoFactory NavInfo { get; }
+
+ protected AbstractLibraryService(Guid libraryId, __SymbolToolLanguage preferredLanguage)
+ {
+ this.LibraryId = libraryId;
+ this.PreferredLanguage = preferredLanguage;
+
+ this.NavInfo = new NavInfoFactory(libraryId, preferredLanguage);
+ }
+ }
+}
diff --git a/src/VisualStudio/Core/Def/Implementation/Library/ILibraryService.cs b/src/VisualStudio/Core/Def/Implementation/Library/ILibraryService.cs
new file mode 100644
index 0000000000000000000000000000000000000000..fb4ccc1de58d8b1bcff88a8eb550c58e25280160
--- /dev/null
+++ b/src/VisualStudio/Core/Def/Implementation/Library/ILibraryService.cs
@@ -0,0 +1,12 @@
+// 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 Microsoft.CodeAnalysis.Host;
+using Microsoft.VisualStudio.LanguageServices.Implementation.Library.VsNavInfo;
+
+namespace Microsoft.VisualStudio.LanguageServices.Implementation.Library
+{
+ internal interface ILibraryService : ILanguageService
+ {
+ NavInfoFactory NavInfo { get; }
+ }
+}
diff --git a/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/AbstractDescriptionBuilder.cs b/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/AbstractDescriptionBuilder.cs
index 3948f6fff8c4f4d415544f3baccf46603d4df666..7bf3acfdc4d9153a5ab47ededbbaf1822563ede3 100644
--- a/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/AbstractDescriptionBuilder.cs
+++ b/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/AbstractDescriptionBuilder.cs
@@ -44,7 +44,7 @@ private Compilation GetCompilation()
protected void AddAssemblyLink(IAssemblySymbol assemblySymbol)
{
var name = assemblySymbol.Identity.Name;
- var navInfo = _libraryManager.NavInfoFactory.CreateForAssembly(assemblySymbol);
+ var navInfo = _libraryManager.LibraryService.NavInfo.CreateForAssembly(assemblySymbol);
_description.AddDescriptionText3(name, VSOBDESCRIPTIONSECTION.OBDS_TYPE, navInfo);
}
@@ -82,7 +82,7 @@ protected void AddNamespaceLink(INamespaceSymbol namespaceSymbol)
}
var text = namespaceSymbol.ToDisplayString();
- var navInfo = _libraryManager.NavInfoFactory.CreateForNamespace(namespaceSymbol, _project, GetCompilation(), useExpandedHierarchy: false);
+ var navInfo = _libraryManager.LibraryService.NavInfo.CreateForNamespace(namespaceSymbol, _project, GetCompilation(), useExpandedHierarchy: false);
_description.AddDescriptionText3(text, VSOBDESCRIPTIONSECTION.OBDS_TYPE, navInfo);
}
@@ -131,7 +131,7 @@ protected void AddTypeLink(ITypeSymbol typeSymbol, LinkFlags flags)
miscellaneousOptions: miscellaneousOptions);
var text = typeSymbol.ToDisplayString(typeDisplayFormat);
- var navInfo = _libraryManager.NavInfoFactory.CreateForType(typeSymbol, _project, GetCompilation(), useExpandedHierarchy: false);
+ var navInfo = _libraryManager.LibraryService.NavInfo.CreateForType(typeSymbol, _project, GetCompilation(), useExpandedHierarchy: false);
_description.AddDescriptionText3(text, VSOBDESCRIPTIONSECTION.OBDS_TYPE, navInfo);
}
diff --git a/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/AbstractObjectBrowserLibraryManager.cs b/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/AbstractObjectBrowserLibraryManager.cs
index 7b6773a7758aaf6c55ce4d25e5d37c9fb5ff663a..c82b3a430136050f183f5d925784fe8479541869 100644
--- a/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/AbstractObjectBrowserLibraryManager.cs
+++ b/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/AbstractObjectBrowserLibraryManager.cs
@@ -7,7 +7,6 @@
using Microsoft.CodeAnalysis;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.LanguageServices.Implementation.Library.ObjectBrowser.Lists;
-using Microsoft.VisualStudio.LanguageServices.Implementation.Library.VsNavInfo;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
@@ -19,9 +18,8 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.Library.ObjectB
{
internal abstract partial class AbstractObjectBrowserLibraryManager : AbstractLibraryManager, IDisposable
{
- internal NavInfoFactory NavInfoFactory { get; }
-
internal readonly VisualStudioWorkspace Workspace;
+ internal readonly ILibraryService LibraryService;
private readonly string _languageName;
private readonly __SymbolToolLanguage _preferredLanguage;
@@ -39,10 +37,10 @@ protected AbstractObjectBrowserLibraryManager(string languageName, Guid libraryG
{
_languageName = languageName;
_preferredLanguage = preferredLanguage;
- NavInfoFactory = new NavInfoFactory(libraryGuid, preferredLanguage);
var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));
this.Workspace = componentModel.GetService();
+ this.LibraryService = this.Workspace.Services.GetLanguageServices(languageName).GetService();
this.Workspace.WorkspaceChanged += OnWorkspaceChanged;
}
@@ -401,7 +399,7 @@ protected override int CreateNavInfo(SYMBOL_DESCRIPTION_NODE[] rgSymbolNodes, ui
SharedPools.Default().ClearAndFree(className);
// TODO: Make sure we pass the right value for Visual Basic.
- ppNavInfo = NavInfoFactory.Create(libraryName, referenceOwnerName, namespaceName.ToString(), className.ToString(), memberName);
+ ppNavInfo = this.LibraryService.NavInfo.Create(libraryName, referenceOwnerName, namespaceName.ToString(), className.ToString(), memberName);
return VSConstants.S_OK;
}
@@ -428,18 +426,18 @@ internal IVsNavInfo GetNavInfo(SymbolListItem symbolListItem, bool useExpandedHi
if (symbolListItem is MemberListItem)
{
- return NavInfoFactory.CreateForMember(symbol, project, compilation, useExpandedHierarchy);
+ return this.LibraryService.NavInfo.CreateForMember(symbol, project, compilation, useExpandedHierarchy);
}
else if (symbolListItem is TypeListItem)
{
- return NavInfoFactory.CreateForType((INamedTypeSymbol)symbol, project, compilation, useExpandedHierarchy);
+ return this.LibraryService.NavInfo.CreateForType((INamedTypeSymbol)symbol, project, compilation, useExpandedHierarchy);
}
else if (symbolListItem is NamespaceListItem)
{
- return NavInfoFactory.CreateForNamespace((INamespaceSymbol)symbol, project, compilation, useExpandedHierarchy);
+ return this.LibraryService.NavInfo.CreateForNamespace((INamespaceSymbol)symbol, project, compilation, useExpandedHierarchy);
}
- return NavInfoFactory.CreateForProject(project);
+ return this.LibraryService.NavInfo.CreateForProject(project);
}
protected override bool TryQueryStatus(Guid commandGroup, uint commandId, ref OLECMDF commandFlags)
diff --git a/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/ObjectList.cs b/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/ObjectList.cs
index 7ff62dcfa91def5d732a5f41a7d249caae766055..23b9449ed2c1f723e97b5133928128bc0c7b94c8 100644
--- a/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/ObjectList.cs
+++ b/src/VisualStudio/Core/Def/Implementation/Library/ObjectBrowser/ObjectList.cs
@@ -564,14 +564,14 @@ protected override IVsNavInfo GetNavInfo(uint index)
var project = this.LibraryManager.GetProject(projectListItem.ProjectId);
if (project != null)
{
- return this.LibraryManager.NavInfoFactory.CreateForProject(project);
+ return this.LibraryManager.LibraryService.NavInfo.CreateForProject(project);
}
}
var referenceListItem = listItem as ReferenceListItem;
if (referenceListItem != null)
{
- return this.LibraryManager.NavInfoFactory.CreateForReference(referenceListItem.MetadataReference);
+ return this.LibraryManager.LibraryService.NavInfo.CreateForReference(referenceListItem.MetadataReference);
}
var symbolListItem = listItem as SymbolListItem;
diff --git a/src/VisualStudio/Core/Def/ServicesVisualStudio.csproj b/src/VisualStudio/Core/Def/ServicesVisualStudio.csproj
index aa203047b2d2e0d4fc7198a06091bba4e04488c4..c594aad1462d278b7e1fa41db4177df2ee6dc469 100644
--- a/src/VisualStudio/Core/Def/ServicesVisualStudio.csproj
+++ b/src/VisualStudio/Core/Def/ServicesVisualStudio.csproj
@@ -44,9 +44,11 @@
+
+
diff --git a/src/VisualStudio/VisualBasic/Impl/BasicVisualStudio.vbproj b/src/VisualStudio/VisualBasic/Impl/BasicVisualStudio.vbproj
index e887d455bb87b715a7d3cacf66e3e2a7321cba03..fb0eafc1daf2c59e05f7474490b8b755a565d377 100644
--- a/src/VisualStudio/VisualBasic/Impl/BasicVisualStudio.vbproj
+++ b/src/VisualStudio/VisualBasic/Impl/BasicVisualStudio.vbproj
@@ -127,6 +127,8 @@
+
+
@@ -293,4 +295,4 @@
-
+
\ No newline at end of file
diff --git a/src/VisualStudio/VisualBasic/Impl/ObjectBrowser/VisualBasicLibraryService.vb b/src/VisualStudio/VisualBasic/Impl/ObjectBrowser/VisualBasicLibraryService.vb
new file mode 100644
index 0000000000000000000000000000000000000000..aef6a5935b437d948039aa047fdd3339f499295a
--- /dev/null
+++ b/src/VisualStudio/VisualBasic/Impl/ObjectBrowser/VisualBasicLibraryService.vb
@@ -0,0 +1,14 @@
+' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+Imports Microsoft.VisualStudio.LanguageServices.Implementation.Library
+Imports Microsoft.VisualStudio.Shell.Interop
+
+Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.ObjectBrowser
+ Friend Class VisualBasicLibraryService
+ Inherits AbstractLibraryService
+
+ Public Sub New()
+ MyBase.New(Guids.VisualBasicLibraryId, __SymbolToolLanguage.SymbolToolLanguage_VB)
+ End Sub
+ End Class
+End Namespace
diff --git a/src/VisualStudio/VisualBasic/Impl/ObjectBrowser/VisualBasicLibraryServiceFactory.vb b/src/VisualStudio/VisualBasic/Impl/ObjectBrowser/VisualBasicLibraryServiceFactory.vb
new file mode 100644
index 0000000000000000000000000000000000000000..8246f8bab33e4d0d4334cd02df031ac5305ce133
--- /dev/null
+++ b/src/VisualStudio/VisualBasic/Impl/ObjectBrowser/VisualBasicLibraryServiceFactory.vb
@@ -0,0 +1,18 @@
+' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+Imports System.Composition
+Imports Microsoft.CodeAnalysis
+Imports Microsoft.CodeAnalysis.Host
+Imports Microsoft.CodeAnalysis.Host.Mef
+Imports Microsoft.VisualStudio.LanguageServices.Implementation.Library
+
+Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.ObjectBrowser
+
+ Friend Class VisualBasicLibraryServiceFactory
+ Implements ILanguageServiceFactory
+
+ Public Function CreateLanguageService(languageServices As HostLanguageServices) As ILanguageService Implements ILanguageServiceFactory.CreateLanguageService
+ Return New VisualBasicLibraryService()
+ End Function
+ End Class
+End Namespace
\ No newline at end of file