-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add F# support #1670
Merged
Merged
Add F# support #1670
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6c2e4c7
Add projects for F#
srivatsn 9327143
Create a F# project system package and add rules and design time targ…
srivatsn 3281ee9
Add an image provider for F# project root node.
srivatsn d71cd09
Hack around CreateProjectContext needing a different overload for F#
srivatsn dcdaec6
Add a F# commandline parser stub.
srivatsn 6bf4280
Add F# test projects.
srivatsn b0746c6
Merging with upstream/master
srivatsn e9ca79b
Mark all components as supporting the FSharp capability and remove th…
srivatsn c6a274f
Adding a guid provider and adding tests.
srivatsn 1ad8207
Add a F# property page provider with all the guids pages. The pages t…
srivatsn d29be9b
Add setupauthoring for the targets and xaml files. Localization still…
srivatsn 1b9f303
Fix typo Csc->Fsc
srivatsn c93fa03
Merge remote-tracking branch 'upstream/master' into fsharp
srivatsn 94459bb
Bring back ProjectCapabilities.CSharpOrVisualBasic because the newly …
srivatsn 018b486
Add FSharp as a default capability and disable async project tree load.
srivatsn 72e11e7
Remove registration of the Debug prop page since that'll be registere…
srivatsn 87cc359
Use the Managed capability instead of CSharpOrVisualBasicOrFsharp
srivatsn 4a9bdd8
Remove the registration of SingleFileGenerators since the old F# PS d…
srivatsn 91e5b1c
Merge remote-tracking branch 'upstream/master' into fsharp
srivatsn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ojectSystem.FSharp.UnitTests/Microsoft.VisualStudio.ProjectSystem.FSharp.UnitTests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. --> | ||
<Project> | ||
<Import Project="..\..\build\Targets\VSL.Settings.targets" /> | ||
<PropertyGroup> | ||
<RootNamespace>Microsoft.VisualStudio</RootNamespace> | ||
<TargetFramework>net46</TargetFramework> | ||
<SignAssembly>true</SignAssembly> | ||
<Nonshipping>true</Nonshipping> | ||
<UseCommonOutputDirectory>true</UseCommonOutputDirectory> | ||
<OutDir>$(OutDir)Tests\</OutDir> | ||
<ProjectSystemLayer>HostAgnostic</ProjectSystemLayer> | ||
<ProjectSystemProjectType>Test</ProjectSystemProjectType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<InternalsVisibleToTest Include="Microsoft.VisualStudio.ProjectSystem.FSharp.VS.UnitTests" /> | ||
<InternalsVisibleToMoq Include="DynamicProxyGenAssembly2" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\DeployTestDependencies\DeployTestDependencies.csproj"> | ||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
</ProjectReference> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.FSharp\Microsoft.VisualStudio.ProjectSystem.FSharp.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.TestServices\Microsoft.VisualStudio.ProjectSystem.Managed.TestServices.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests\Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed\Microsoft.VisualStudio.ProjectSystem.Managed.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests\Properties\AssemblyAttributes.cs"> | ||
<Link>Properties\AssemblyAttributes.cs</Link> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="..\Common\Test\App.config"> | ||
<Link>App.config</Link> | ||
</None> | ||
</ItemGroup> | ||
<Import Project="..\..\build\Targets\VSL.Imports.targets" /> | ||
</Project> |
44 changes: 44 additions & 0 deletions
44
...ystem.FSharp.VS.UnitTests/Microsoft.VisualStudio.ProjectSystem.FSharp.VS.UnitTests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. --> | ||
<Project> | ||
<Import Project="..\..\build\Targets\VSL.Settings.targets" /> | ||
<PropertyGroup> | ||
<RootNamespace>Microsoft.VisualStudio</RootNamespace> | ||
<TargetFramework>net46</TargetFramework> | ||
<SignAssembly>true</SignAssembly> | ||
<Nonshipping>true</Nonshipping> | ||
<UseCommonOutputDirectory>true</UseCommonOutputDirectory> | ||
<OutDir>$(OutDir)Tests\</OutDir> | ||
<ProjectSystemLayer>VisualStudio</ProjectSystemLayer> | ||
<ProjectSystemProjectType>Test</ProjectSystemProjectType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<InternalsVisibleToMoq Include="DynamicProxyGenAssembly2" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\DeployTestDependencies\DeployTestDependencies.csproj"> | ||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
</ProjectReference> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.FSharp.VS\Microsoft.VisualStudio.ProjectSystem.FSharp.VS.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.FSharp\Microsoft.VisualStudio.ProjectSystem.FSharp.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.TestServices\Microsoft.VisualStudio.ProjectSystem.Managed.TestServices.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests\Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests\Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.VS\Microsoft.VisualStudio.ProjectSystem.Managed.VS.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed\Microsoft.VisualStudio.ProjectSystem.Managed.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests\Properties\AssemblyAttributes.cs"> | ||
<Link>Properties\AssemblyAttributes.cs</Link> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="..\Common\Test\App.config"> | ||
<Link>App.config</Link> | ||
</None> | ||
</ItemGroup> | ||
<Import Project="..\..\build\Targets\VSL.Imports.targets" /> | ||
<Import Project="..\..\build\Targets\Roslyn.Toolsets.Xunit.targets" /> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
...sualStudio.ProjectSystem.FSharp.VS.UnitTests/Packaging/FSharpProjectSystemPackageTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// 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 Xunit; | ||
|
||
namespace Microsoft.VisualStudio.Packaging | ||
{ | ||
[ProjectSystemTrait] | ||
public class FSharpProjectSystemPackageTests | ||
{ | ||
[Fact] | ||
public void Constructor_DoesNotThrow() | ||
{ | ||
new FSharpProjectSystemPackage(); | ||
} | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...ectSystem.FSharp.VS.UnitTests/ProjectSystem/VS/Imaging/FSharpProjectImageProviderTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// 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.ProjectSystem.Imaging; | ||
using Xunit; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.VS.Imaging | ||
{ | ||
[ProjectSystemTrait] | ||
public class FSharpProjectImageProviderTests | ||
{ | ||
[Fact] | ||
public void Constructor_DoesNotThrow() | ||
{ | ||
new FSharpProjectImageProvider(); | ||
} | ||
|
||
[Fact] | ||
public void GetProjectImage_NullAsKey_ThrowsArgumentNull() | ||
{ | ||
var provider = CreateInstance(); | ||
|
||
Assert.Throws<ArgumentNullException>("key", () => { | ||
|
||
provider.GetProjectImage((string)null); | ||
}); | ||
} | ||
|
||
|
||
[Fact] | ||
public void GetProjectImage_EmptyAsKey_ThrowsArgument() | ||
{ | ||
var provider = CreateInstance(); | ||
|
||
Assert.Throws<ArgumentException>("key", () => { | ||
|
||
provider.GetProjectImage(string.Empty); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void GetProjectImage_UnrecognizedKeyAsKey_ReturnsNull() | ||
{ | ||
var provider = CreateInstance(); | ||
|
||
var result = provider.GetProjectImage("Unrecognized"); | ||
|
||
Assert.Null(result); | ||
} | ||
|
||
[Theory] | ||
[InlineData(ProjectImageKey.ProjectRoot)] | ||
[InlineData(ProjectImageKey.AppDesignerFolder)] | ||
public void GetProjectImage_RecognizedKeyAsKey_ReturnsNonNull(string key) | ||
{ | ||
var provider = CreateInstance(); | ||
|
||
var result = provider.GetProjectImage(key); | ||
|
||
Assert.NotNull(result); | ||
} | ||
|
||
private static FSharpProjectImageProvider CreateInstance() | ||
{ | ||
return new FSharpProjectImageProvider(); | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...FSharp.VS.UnitTests/ProjectSystem/VS/Properties/FSharpProjectDesignerPageProviderTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// 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 System.Linq; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.VS.Properties | ||
{ | ||
[ProjectSystemTrait] | ||
public class FSharpProjectDesignerPageProviderTests | ||
{ | ||
[Fact] | ||
public void Constructor_DoesNotThrow() | ||
{ | ||
CreateInstance(); | ||
} | ||
|
||
[Fact] | ||
public async Task GetPagesAsync_ReturnsPagesInOrder() | ||
{ | ||
var provider = CreateInstance(); | ||
var pages = await provider.GetPagesAsync(); | ||
|
||
Assert.Equal(pages.Count(), 5); | ||
Assert.Same(pages.ElementAt(0), FSharpProjectDesignerPage.Application); | ||
Assert.Same(pages.ElementAt(1), FSharpProjectDesignerPage.Build); | ||
Assert.Same(pages.ElementAt(2), FSharpProjectDesignerPage.BuildEvents); | ||
Assert.Same(pages.ElementAt(3), FSharpProjectDesignerPage.Debug); | ||
Assert.Same(pages.ElementAt(4), FSharpProjectDesignerPage.ReferencePaths); | ||
} | ||
|
||
[Fact] | ||
public async Task GetPagesAsync_WithPackCapability() | ||
{ | ||
var provider = CreateInstance(ProjectCapability.Pack); | ||
var pages = await provider.GetPagesAsync(); | ||
|
||
Assert.Equal(pages.Count(), 6); | ||
Assert.Same(pages.ElementAt(0), FSharpProjectDesignerPage.Application); | ||
Assert.Same(pages.ElementAt(1), FSharpProjectDesignerPage.Build); | ||
Assert.Same(pages.ElementAt(2), FSharpProjectDesignerPage.BuildEvents); | ||
Assert.Same(pages.ElementAt(3), FSharpProjectDesignerPage.Debug); | ||
Assert.Same(pages.ElementAt(4), FSharpProjectDesignerPage.Package); | ||
Assert.Same(pages.ElementAt(5), FSharpProjectDesignerPage.ReferencePaths); | ||
} | ||
|
||
private static FSharpProjectDesignerPageProvider CreateInstance(params string[] capabilities) | ||
{ | ||
Func<string, bool> containsCapability = c => capabilities.Contains(c); | ||
var capabilitiesService = IProjectCapabilitiesServiceFactory.ImplementsContains(containsCapability); | ||
return new FSharpProjectDesignerPageProvider(capabilitiesService); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Microsoft.VisualStudio.ProjectSystem.FSharp.VS/GlobalSuppressions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
| ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
// workaround for https://github.com/dotnet/roslyn-analyzers/issues/955 | ||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( | ||
"Reliability", | ||
"RS0006:Do not mix attributes from different versions of MEF", | ||
Justification = "<Pending>")] |
29 changes: 29 additions & 0 deletions
29
...isualStudio.ProjectSystem.FSharp.VS/Microsoft.VisualStudio.ProjectSystem.FSharp.VS.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. --> | ||
<Project> | ||
<Import Project="..\..\build\Targets\VSL.Settings.targets" /> | ||
<PropertyGroup> | ||
<RootNamespace>Microsoft.VisualStudio</RootNamespace> | ||
<TargetFramework>net46</TargetFramework> | ||
<GeneratePkgDefFile>true</GeneratePkgDefFile> | ||
<ImportVSSDKTargets>true</ImportVSSDKTargets> | ||
<CreateVsixContainer>false</CreateVsixContainer> | ||
<DeployExtension>false</DeployExtension> | ||
<UseCodebase>true</UseCodebase> | ||
<SignAssembly>true</SignAssembly> | ||
<UseCommonOutputDirectory>true</UseCommonOutputDirectory> | ||
<ProjectSystemLayer>VisualStudio</ProjectSystemLayer> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<InternalsVisibleToTest Include="Microsoft.VisualStudio.ProjectSystem.FSharp.VS.UnitTests" /> | ||
<InternalsVisibleToMoq Include="DynamicProxyGenAssembly2" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Properties\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.FSharp\Microsoft.VisualStudio.ProjectSystem.FSharp.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed.VS\Microsoft.VisualStudio.ProjectSystem.Managed.VS.csproj" /> | ||
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed\Microsoft.VisualStudio.ProjectSystem.Managed.csproj" /> | ||
</ItemGroup> | ||
<Import Project="..\..\build\Targets\VSL.Imports.targets" /> | ||
</Project> |
29 changes: 29 additions & 0 deletions
29
src/Microsoft.VisualStudio.ProjectSystem.FSharp.VS/Packaging/FSharpProjectSystemPackage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 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 System.Runtime.InteropServices; | ||
using Microsoft.VisualStudio.Packaging; | ||
using Microsoft.VisualStudio.ProjectSystem.VS; | ||
using Microsoft.VisualStudio.Shell; | ||
using Microsoft.VisualStudio.ProjectSystem; | ||
|
||
// We register ourselves as a new CPS "project type" | ||
[assembly: ProjectTypeRegistration(projectTypeGuid: FSharpProjectSystemPackage.ProjectTypeGuid, displayName: "#1", displayProjectFileExtensions: "#2", defaultProjectExtension: "fsproj", language: "FSharp", resourcePackageGuid: FSharpProjectSystemPackage.PackageGuid, Capabilities = ManagedProjectSystemPackage.DefaultCapabilities + "; " + ProjectCapability.FSharp, DisableAsynchronousProjectTreeLoad = true)] | ||
|
||
namespace Microsoft.VisualStudio.Packaging | ||
{ | ||
[Guid(PackageGuid)] | ||
[PackageRegistration(AllowsBackgroundLoading = true, RegisterUsing = RegistrationMethod.CodeBase, UseManagedResourcesOnly = true)] | ||
[DplOptOutRegistration(ProjectTypeGuid, true)] | ||
internal class FSharpProjectSystemPackage : AsyncPackage | ||
{ | ||
public const string ProjectTypeGuid = "6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705"; | ||
public const string LegacyProjectTypeGuid = "F2A71F9B-5D33-465A-A702-920D77279786"; | ||
public const string PackageGuid = "a724c878-e8fd-4feb-b537-60baba7eda83"; | ||
private const string ProjectTypeGuidFormatted = "{" + ProjectTypeGuid + "}"; | ||
|
||
public FSharpProjectSystemPackage() | ||
{ | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...rosoft.VisualStudio.ProjectSystem.FSharp.VS/ProjectSystem/VS/FSharpProjectGuidProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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 System.ComponentModel.Composition; | ||
using Microsoft.VisualStudio.Packaging; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.VS | ||
{ | ||
/// <summary> | ||
/// Provides the Visual Basic implementation of <see cref="IItemTypeGuidProvider"/>. | ||
/// </summary> | ||
[Export(typeof(IItemTypeGuidProvider))] | ||
[AppliesTo(ProjectCapability.FSharp)] | ||
internal class FSharpProjectGuidProvider : IItemTypeGuidProvider | ||
{ | ||
private static readonly Guid s_fsharpProjectType = new Guid(FSharpProjectSystemPackage.LegacyProjectTypeGuid); | ||
|
||
[ImportingConstructor] | ||
public FSharpProjectGuidProvider(UnconfiguredProject unconfiguredProject) | ||
{ | ||
Requires.NotNull(unconfiguredProject, nameof(unconfiguredProject)); | ||
} | ||
|
||
public Guid ProjectTypeGuid | ||
{ | ||
get { return s_fsharpProjectType; } | ||
} | ||
|
||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...sualStudio.ProjectSystem.FSharp.VS/ProjectSystem/VS/Imaging/FSharpProjectImageProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// 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.ComponentModel.Composition; | ||
using Microsoft.VisualStudio.Imaging; | ||
using Microsoft.VisualStudio.ProjectSystem.Imaging; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.VS.Imaging | ||
{ | ||
/// <summary> | ||
/// Provides C# project images. | ||
/// </summary> | ||
[Export(typeof(IProjectImageProvider))] | ||
[AppliesTo(ProjectCapability.FSharp)] | ||
[Order(2)] | ||
internal class FSharpProjectImageProvider : IProjectImageProvider | ||
{ | ||
[ImportingConstructor] | ||
public FSharpProjectImageProvider() | ||
{ | ||
} | ||
|
||
public ProjectImageMoniker GetProjectImage(string key) | ||
{ | ||
Requires.NotNullOrEmpty(key, nameof(key)); | ||
|
||
switch (key) | ||
{ | ||
case ProjectImageKey.ProjectRoot: | ||
return KnownMonikers.FSProjectNode.ToProjectSystemType(); | ||
|
||
case ProjectImageKey.AppDesignerFolder: | ||
return KnownMonikers.Property.ToProjectSystemType(); | ||
|
||
default: | ||
return null; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visual Basic
->FSharp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there are lot of places where Visual Basic or C# will be present instead of F#. As we implement the component we should update these files.