From a223532fe20fd04c349acc9c8e491a0d59325d9d Mon Sep 17 00:00:00 2001 From: FiniteReality Date: Sun, 28 Nov 2021 14:20:47 +0000 Subject: [PATCH] Add Primitive Visual Studio IDE support --- .editorconfig | 2 +- Directory.Build.targets | 3 + Finite.Cpp.Sdk.sln | 33 ++++++-- samples/Directory.Build.props | 6 ++ src/Core/ClangCompile.cs | 3 + src/Core/ClangLink.cs | 10 ++- src/Core/targets/Finite.Cpp.Sdk.CXX.targets | 6 ++ src/Core/targets/Finite.Cpp.Sdk.targets | 8 -- src/VisualStudio/Capabilities/ProjectTypes.cs | 32 +++++++ ...nfigurationDimensionProvider.Dimensions.cs | 18 ++++ .../ProjectConfigurationDimensionProvider.cs | 78 ++++++++++++++++++ src/VisualStudio/CppSdkPackage.cs | 20 +++++ ...inite.Cpp.Sdk.CPlusPlus.DesignTime.targets | 12 +++ .../Finite.Cpp.Sdk.DesignTime.targets | 50 +++++++++++ .../Finite.Cpp.Sdk.VisualStudio.csproj | 56 +++++++++++++ src/VisualStudio/IsExternalInit.cs | 10 +++ .../Languages/Cpp/CppUnconfiguredProject.cs | 13 +++ .../Languages/Cpp/ProjectTypeRegistration.cs | 16 ++++ src/VisualStudio/ProjectType.cs | 7 ++ .../ProvideEditorFactoryMappingAttribute.cs | 28 +++++++ .../Rules/Items/Compile.BrowseObject.xaml | 43 ++++++++++ src/VisualStudio/Rules/Items/Compile.xaml | 19 +++++ .../Items/ProjectItemsSchema.CPlusPlus.xaml | 8 ++ .../Projects/CppProject/CppProject.cxxproj | 3 + .../Projects/CppProject/CppProject.ico | Bin 0 -> 1270 bytes .../Templates/Projects/CppProject/Test.cpp | 7 ++ .../source.extension.vsixmanifest | 20 +++++ 27 files changed, 494 insertions(+), 17 deletions(-) create mode 100644 src/VisualStudio/Capabilities/ProjectTypes.cs create mode 100644 src/VisualStudio/Configuration/ProjectConfigurationDimensionProvider.Dimensions.cs create mode 100644 src/VisualStudio/Configuration/ProjectConfigurationDimensionProvider.cs create mode 100644 src/VisualStudio/CppSdkPackage.cs create mode 100644 src/VisualStudio/DesignTime/Finite.Cpp.Sdk.CPlusPlus.DesignTime.targets create mode 100644 src/VisualStudio/DesignTime/Finite.Cpp.Sdk.DesignTime.targets create mode 100644 src/VisualStudio/Finite.Cpp.Sdk.VisualStudio.csproj create mode 100644 src/VisualStudio/IsExternalInit.cs create mode 100644 src/VisualStudio/Languages/Cpp/CppUnconfiguredProject.cs create mode 100644 src/VisualStudio/Languages/Cpp/ProjectTypeRegistration.cs create mode 100644 src/VisualStudio/ProjectType.cs create mode 100644 src/VisualStudio/ProvideEditorFactoryMappingAttribute.cs create mode 100644 src/VisualStudio/Rules/Items/Compile.BrowseObject.xaml create mode 100644 src/VisualStudio/Rules/Items/Compile.xaml create mode 100644 src/VisualStudio/Rules/Items/ProjectItemsSchema.CPlusPlus.xaml create mode 100644 src/VisualStudio/Templates/Projects/CppProject/CppProject.cxxproj create mode 100644 src/VisualStudio/Templates/Projects/CppProject/CppProject.ico create mode 100644 src/VisualStudio/Templates/Projects/CppProject/Test.cpp create mode 100644 src/VisualStudio/source.extension.vsixmanifest diff --git a/.editorconfig b/.editorconfig index 0c8d2d6..3876195 100644 --- a/.editorconfig +++ b/.editorconfig @@ -27,7 +27,7 @@ trim_trailing_whitespace = true # Set file behavior to: # 2 space indentation ############################################################################### -[*.{cmd,config,csproj,cproj,cxxproj,json,nuspec,pkgproj,props,ps1,resx,sh,tasks,targets,yml}] +[*.{cmd,config,csproj,cproj,cxxproj,xml,xaml,json,nuspec,pkgproj,props,ps1,resx,sh,tasks,targets,yml}] indent_size = 2 ############################################################################### diff --git a/Directory.Build.targets b/Directory.Build.targets index 26f4f0b..9eb8855 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -25,6 +25,9 @@ + + + diff --git a/Finite.Cpp.Sdk.sln b/Finite.Cpp.Sdk.sln index caaa019..acd739f 100644 --- a/Finite.Cpp.Sdk.sln +++ b/Finite.Cpp.Sdk.sln @@ -1,11 +1,16 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 MinimumVisualStudioVersion = 15.0.26124.0 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D63BE145-0B9A-4A0C-834D-EF9E8F007B2D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Finite.Cpp.Sdk", "src\Core\Finite.Cpp.Sdk.csproj", "{012461A5-B00E-41AD-8EA1-7866A8B1F8A5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Finite.Cpp.Sdk", "src\Core\Finite.Cpp.Sdk.csproj", "{012461A5-B00E-41AD-8EA1-7866A8B1F8A5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Finite.Cpp.Sdk.VisualStudio", "src\VisualStudio\Finite.Cpp.Sdk.VisualStudio.csproj", "{DF68DB18-A68D-4641-8B58-9961D0FE4DF9}" + ProjectSection(ProjectDependencies) = postProject + {012461A5-B00E-41AD-8EA1-7866A8B1F8A5} = {012461A5-B00E-41AD-8EA1-7866A8B1F8A5} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,9 +21,6 @@ Global Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {012461A5-B00E-41AD-8EA1-7866A8B1F8A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {012461A5-B00E-41AD-8EA1-7866A8B1F8A5}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -32,8 +34,27 @@ Global {012461A5-B00E-41AD-8EA1-7866A8B1F8A5}.Release|x64.Build.0 = Release|Any CPU {012461A5-B00E-41AD-8EA1-7866A8B1F8A5}.Release|x86.ActiveCfg = Release|Any CPU {012461A5-B00E-41AD-8EA1-7866A8B1F8A5}.Release|x86.Build.0 = Release|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Debug|x64.ActiveCfg = Debug|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Debug|x64.Build.0 = Debug|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Debug|x86.ActiveCfg = Debug|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Debug|x86.Build.0 = Debug|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Release|Any CPU.Build.0 = Release|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Release|x64.ActiveCfg = Release|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Release|x64.Build.0 = Release|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Release|x86.ActiveCfg = Release|Any CPU + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {012461A5-B00E-41AD-8EA1-7866A8B1F8A5} = {D63BE145-0B9A-4A0C-834D-EF9E8F007B2D} + {DF68DB18-A68D-4641-8B58-9961D0FE4DF9} = {D63BE145-0B9A-4A0C-834D-EF9E8F007B2D} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {089CD4E0-CE16-4B84-A2CD-65A12FC98CB2} EndGlobalSection EndGlobal diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props index 96e850f..d6dbc72 100644 --- a/samples/Directory.Build.props +++ b/samples/Directory.Build.props @@ -23,4 +23,10 @@ + + + $(BaseArtifactsPath)bin\src\Finite.Cpp.Sdk.VisualStudio\Debug\net472\DesignTime\ + $(VisualStudioDesignTimeFiles)Finite.Cpp.Sdk.CPlusPlus.DesignTime.targets + + diff --git a/src/Core/ClangCompile.cs b/src/Core/ClangCompile.cs index eb2f83b..1165d1a 100644 --- a/src/Core/ClangCompile.cs +++ b/src/Core/ClangCompile.cs @@ -210,6 +210,9 @@ protected override string GenerateFullPathToTool() if (File.Exists(fullPath)) return fullPath; } + + Log.LogError($"Could not find {ToolName} executable"); + return null!; } diff --git a/src/Core/ClangLink.cs b/src/Core/ClangLink.cs index 4a8fb6d..259f441 100644 --- a/src/Core/ClangLink.cs +++ b/src/Core/ClangLink.cs @@ -183,8 +183,11 @@ to the system linker which has different behaviour on if (Language == "C++") { - builder.AppendSwitch("-lstdc++"); - builder.AppendSwitch("-lm"); + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + builder.AppendSwitch("-lstdc++"); + builder.AppendSwitch("-lm"); + } } if (EnableDebugSymbols) @@ -245,6 +248,9 @@ protected override string GenerateFullPathToTool() if (File.Exists(fullPath)) return fullPath; } + + Log.LogError($"Could not find {ToolName} executable"); + return null!; } diff --git a/src/Core/targets/Finite.Cpp.Sdk.CXX.targets b/src/Core/targets/Finite.Cpp.Sdk.CXX.targets index 10c16d9..593bf48 100644 --- a/src/Core/targets/Finite.Cpp.Sdk.CXX.targets +++ b/src/Core/targets/Finite.Cpp.Sdk.CXX.targets @@ -8,4 +8,10 @@ Unmanaged + + $(MSBuildExtensionsPath)\FiniteCppSdk\Finite.Cpp.Sdk.CPlusPlus.DesignTime.targets + + + + diff --git a/src/Core/targets/Finite.Cpp.Sdk.targets b/src/Core/targets/Finite.Cpp.Sdk.targets index dcc0ff0..a2e34be 100644 --- a/src/Core/targets/Finite.Cpp.Sdk.targets +++ b/src/Core/targets/Finite.Cpp.Sdk.targets @@ -213,12 +213,4 @@ - - - - - - - - diff --git a/src/VisualStudio/Capabilities/ProjectTypes.cs b/src/VisualStudio/Capabilities/ProjectTypes.cs new file mode 100644 index 0000000..8cd53b2 --- /dev/null +++ b/src/VisualStudio/Capabilities/ProjectTypes.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.VisualStudio.ProjectSystem; + +namespace Finite.Cpp.Sdk.VisualStudio +{ + internal static class Capabilities + { + internal static class ProjectType + { + public const string FiniteCppSdk = nameof(FiniteCppSdk); + public const string CPlusPlus = nameof(CPlusPlus); + } + + internal static class ProjectTypes + { + public const string FiniteCppSdk = + $"{ProjectCapabilities.HandlesOwnReload}; " + + $"{ProjectCapabilities.OpenProjectFile}; " + + $"{ProjectCapabilities.PreserveFormatting}; " + + $"{ProjectCapabilities.ProjectConfigurationsDeclaredDimensions}; " + + $"{ProjectType.FiniteCppSdk}"; + + public const string CPlusPlus = + $"{FiniteCppSdk}; " + + $"{ProjectType.CPlusPlus}"; + } + } +} diff --git a/src/VisualStudio/Configuration/ProjectConfigurationDimensionProvider.Dimensions.cs b/src/VisualStudio/Configuration/ProjectConfigurationDimensionProvider.Dimensions.cs new file mode 100644 index 0000000..fe427c4 --- /dev/null +++ b/src/VisualStudio/Configuration/ProjectConfigurationDimensionProvider.Dimensions.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Finite.Cpp.Sdk.VisualStudio.Configuration +{ + internal sealed partial class ProjectConfigurationDimensionProvider + { + private record Dimension(string Name, string MSBuildProperty, string[] Value); + + private static readonly Dimension ConfigurationDimension + = new("Configuration", "Configurations", new[] { "Debug" }); + private static readonly Dimension PlatformDimension + = new("Platform", "Platforms", new[] { "Native" }); + } +} diff --git a/src/VisualStudio/Configuration/ProjectConfigurationDimensionProvider.cs b/src/VisualStudio/Configuration/ProjectConfigurationDimensionProvider.cs new file mode 100644 index 0000000..3aa7d01 --- /dev/null +++ b/src/VisualStudio/Configuration/ProjectConfigurationDimensionProvider.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Build.Evaluation; +using Microsoft.VisualStudio.ProjectSystem; + +namespace Finite.Cpp.Sdk.VisualStudio.Configuration +{ + //[Export(typeof(IProjectConfigurationDimensionsProvider))] + //[AppliesTo(ProjectCapabilities.ProjectConfigurationsDeclaredDimensions)] + internal sealed partial class ProjectConfigurationDimensionProvider + : IProjectConfigurationDimensionsProvider3 + { + private readonly IProjectLockService _lockService; + + public ProjectConfigurationDimensionProvider(IProjectLockService lockService) + { + _lockService = lockService; + } + + private async Task FindDimensionFromProjectOrDefaultAsync(UnconfiguredProject project, Dimension defaultValue) + { + using var lck = await _lockService.ReadLockAsync(); + var xml = await lck.GetProjectXmlAsync(project.FullPath); + + var property = xml.PropertyGroups + .SelectMany(x => x.Properties) + .FirstOrDefault(x => x.Name.Equals(defaultValue.MSBuildProperty, StringComparison.OrdinalIgnoreCase)); + + return property switch + { + { } => new(property.Name, defaultValue.MSBuildProperty, ProjectCollection.Unescape(property.Value).Split(';')), + _ => defaultValue + }; + } + + public async Task>> GetBestGuessDefaultValuesForDimensionsAsync(UnconfiguredProject project) + { + return AsEnumerable( + await FindDimensionFromProjectOrDefaultAsync(project, ConfigurationDimension), + await FindDimensionFromProjectOrDefaultAsync(project, PlatformDimension) + ); + + static IEnumerable> AsEnumerable(params Dimension[] values) + => values.Select(x => new KeyValuePair(x.Name, string.Join(";", x.Value))); + } + + public async Task>> GetDefaultValuesForDimensionsAsync(UnconfiguredProject project) + { + return AsEnumerable( + await FindDimensionFromProjectOrDefaultAsync(project, ConfigurationDimension), + await FindDimensionFromProjectOrDefaultAsync(project, PlatformDimension) + ); + + static IEnumerable> AsEnumerable(params Dimension[] values) + => values.Select(x => new KeyValuePair(x.Name, x.Value[0])); + } + + public async Task>>> GetProjectConfigurationDimensionsAsync(UnconfiguredProject project) + { + return AsEnumerable( + await FindDimensionFromProjectOrDefaultAsync(project, ConfigurationDimension), + await FindDimensionFromProjectOrDefaultAsync(project, PlatformDimension) + ); + + static IEnumerable>> AsEnumerable(params Dimension[] values) + => values.Select(x => new KeyValuePair>(x.Name, x.Value)); + } + + public Task OnDimensionValueChangedAsync(ProjectConfigurationDimensionValueChangedEventArgs args) + { + return Task.CompletedTask; + } + } +} diff --git a/src/VisualStudio/CppSdkPackage.cs b/src/VisualStudio/CppSdkPackage.cs new file mode 100644 index 0000000..feb2909 --- /dev/null +++ b/src/VisualStudio/CppSdkPackage.cs @@ -0,0 +1,20 @@ +using System; +using System.Runtime.InteropServices; +using System.Threading; +using Microsoft.VisualStudio.Shell; + +namespace Finite.Cpp.Sdk.VisualStudio +{ + [PackageRegistration(AllowsBackgroundLoading = true, UseManagedResourcesOnly = true)] + [InstalledProductRegistration("Finite.Cpp.Sdk", "Cross-platform C/C++ SDK", productId: "memes")] + [Guid(PackageGuid)] + public sealed class CppSdkPackage : AsyncPackage + { + public const string PackageGuid = "780D1924-1B9B-4C3C-82AF-704A61F855D4"; + + protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(); + } + } +} diff --git a/src/VisualStudio/DesignTime/Finite.Cpp.Sdk.CPlusPlus.DesignTime.targets b/src/VisualStudio/DesignTime/Finite.Cpp.Sdk.CPlusPlus.DesignTime.targets new file mode 100644 index 0000000..1c13914 --- /dev/null +++ b/src/VisualStudio/DesignTime/Finite.Cpp.Sdk.CPlusPlus.DesignTime.targets @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/VisualStudio/DesignTime/Finite.Cpp.Sdk.DesignTime.targets b/src/VisualStudio/DesignTime/Finite.Cpp.Sdk.DesignTime.targets new file mode 100644 index 0000000..eef1b88 --- /dev/null +++ b/src/VisualStudio/DesignTime/Finite.Cpp.Sdk.DesignTime.targets @@ -0,0 +1,50 @@ + + + + + false + false + false + + exe;library + true + + Pack + + + + $(MSBuildThisFileDirectory) + + + + $(FiniteCppSdkXamlResourcesDirectory)\ + + + + + + + + + + + + + + + + + + + diff --git a/src/VisualStudio/Finite.Cpp.Sdk.VisualStudio.csproj b/src/VisualStudio/Finite.Cpp.Sdk.VisualStudio.csproj new file mode 100644 index 0000000..8c1d366 --- /dev/null +++ b/src/VisualStudio/Finite.Cpp.Sdk.VisualStudio.csproj @@ -0,0 +1,56 @@ + + + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v16.0 + + + + net472 + 2.0 + 16.0 + + + + true + false + + + + Program + $(DevEnvDir)devenv.exe + /rootsuffix Exp /log + + + + + + + + + + + + + + + + + + + + + + + + + + <_DesignTimeFilesToCopy Include="@(Content)" Condition="'%(Content.InstallRoot)' == 'MSBuild'" /> + + + + + + diff --git a/src/VisualStudio/IsExternalInit.cs b/src/VisualStudio/IsExternalInit.cs new file mode 100644 index 0000000..1e4d0d1 --- /dev/null +++ b/src/VisualStudio/IsExternalInit.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace System.Runtime.CompilerServices +{ + internal sealed class IsExternalInit { } +} diff --git a/src/VisualStudio/Languages/Cpp/CppUnconfiguredProject.cs b/src/VisualStudio/Languages/Cpp/CppUnconfiguredProject.cs new file mode 100644 index 0000000..e8cd80c --- /dev/null +++ b/src/VisualStudio/Languages/Cpp/CppUnconfiguredProject.cs @@ -0,0 +1,13 @@ +using System; +using System.ComponentModel.Composition; +using Microsoft.VisualStudio.ProjectSystem; + + +namespace Finite.Cpp.Sdk.VisualStudio.Languages.Cpp +{ + [Export] + [AppliesTo(Capabilities.ProjectTypes.FiniteCppSdk)] + internal sealed class CppUnconfiguredProject + { + } +} diff --git a/src/VisualStudio/Languages/Cpp/ProjectTypeRegistration.cs b/src/VisualStudio/Languages/Cpp/ProjectTypeRegistration.cs new file mode 100644 index 0000000..38d5390 --- /dev/null +++ b/src/VisualStudio/Languages/Cpp/ProjectTypeRegistration.cs @@ -0,0 +1,16 @@ +using Finite.Cpp.Sdk.VisualStudio; +using Microsoft.VisualStudio.Packaging; +using Microsoft.VisualStudio.ProjectSystem.VS; +using Microsoft.VisualStudio.Shell; + +[assembly: ProjectTypeRegistration( + projectTypeGuid: ProjectType.CPlusPlus, + displayName: "C++", + displayProjectFileExtensions: "C++ Project Files (*.cxxproj);*.cxxproj", + defaultProjectExtension: "cxxproj", + language: "CPlusPlus", + resourcePackageGuid: CppSdkPackage.PackageGuid, + Capabilities = Capabilities.ProjectTypes.CPlusPlus, + PossibleProjectExtensions = "cxxproj", + NewProjectRequireNewFolderVsTemplate = true)] +[assembly: ProvideEditorFactoryMapping("{f6819a78-a205-47b5-be1c-675b3c7f0b8e}", ".cxxproj")] diff --git a/src/VisualStudio/ProjectType.cs b/src/VisualStudio/ProjectType.cs new file mode 100644 index 0000000..360ffb1 --- /dev/null +++ b/src/VisualStudio/ProjectType.cs @@ -0,0 +1,7 @@ +namespace Finite.Cpp.Sdk.VisualStudio +{ + internal static class ProjectType + { + public const string CPlusPlus = "777B85CC-1368-4511-B971-867BABC9623A"; + } +} diff --git a/src/VisualStudio/ProvideEditorFactoryMappingAttribute.cs b/src/VisualStudio/ProvideEditorFactoryMappingAttribute.cs new file mode 100644 index 0000000..4ab256e --- /dev/null +++ b/src/VisualStudio/ProvideEditorFactoryMappingAttribute.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information. + +using System; +using Microsoft.VisualStudio.Shell; + +namespace Microsoft.VisualStudio.Packaging +{ + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + internal sealed class ProvideEditorFactoryMappingAttribute : RegistrationAttribute + { + private readonly ProvideLanguageExtensionAttribute _wrapped; + + public ProvideEditorFactoryMappingAttribute(string editorFactoryGuid, string extension) + { + _wrapped = new ProvideLanguageExtensionAttribute(editorFactoryGuid, extension); + } + + public override void Register(RegistrationContext context) + { + _wrapped.Register(context); + } + + public override void Unregister(RegistrationContext context) + { + _wrapped.Unregister(context); + } + } +} diff --git a/src/VisualStudio/Rules/Items/Compile.BrowseObject.xaml b/src/VisualStudio/Rules/Items/Compile.BrowseObject.xaml new file mode 100644 index 0000000..4e1b245 --- /dev/null +++ b/src/VisualStudio/Rules/Items/Compile.BrowseObject.xaml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/VisualStudio/Rules/Items/Compile.xaml b/src/VisualStudio/Rules/Items/Compile.xaml new file mode 100644 index 0000000..4cb44e1 --- /dev/null +++ b/src/VisualStudio/Rules/Items/Compile.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/src/VisualStudio/Rules/Items/ProjectItemsSchema.CPlusPlus.xaml b/src/VisualStudio/Rules/Items/ProjectItemsSchema.CPlusPlus.xaml new file mode 100644 index 0000000..d42f869 --- /dev/null +++ b/src/VisualStudio/Rules/Items/ProjectItemsSchema.CPlusPlus.xaml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/VisualStudio/Templates/Projects/CppProject/CppProject.cxxproj b/src/VisualStudio/Templates/Projects/CppProject/CppProject.cxxproj new file mode 100644 index 0000000..ac635c2 --- /dev/null +++ b/src/VisualStudio/Templates/Projects/CppProject/CppProject.cxxproj @@ -0,0 +1,3 @@ + + + diff --git a/src/VisualStudio/Templates/Projects/CppProject/CppProject.ico b/src/VisualStudio/Templates/Projects/CppProject/CppProject.ico new file mode 100644 index 0000000000000000000000000000000000000000..920c8bf9c72d3ea56449b1de25857c0f3642b1be GIT binary patch literal 1270 zcmeHD!41PO2&7U6$QXHchW@)w-yY42SZvXsMGlADBcW0i^%-p9<2Yl&^YyvQus6Ol z{1JYWHBln(qAA?5NEus7aRkQ#sI}sB#>N&iM{q2sJihGw1X^p^<)+pXzH35)%CxRb zYeTM{JQ~Xc(2$UidIvs;|L~nNiFcjAKpNX1z=LRsA^&S_guHEy{mP^0u)UrSM4rcX Qfkc4*J)wK;6`z~H0=O}ai2wiq literal 0 HcmV?d00001 diff --git a/src/VisualStudio/Templates/Projects/CppProject/Test.cpp b/src/VisualStudio/Templates/Projects/CppProject/Test.cpp new file mode 100644 index 0000000..15b7d62 --- /dev/null +++ b/src/VisualStudio/Templates/Projects/CppProject/Test.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + std::cout << "Hello, world!\n"; + return 0; +} diff --git a/src/VisualStudio/source.extension.vsixmanifest b/src/VisualStudio/source.extension.vsixmanifest new file mode 100644 index 0000000..58c1aa4 --- /dev/null +++ b/src/VisualStudio/source.extension.vsixmanifest @@ -0,0 +1,20 @@ + + + + + Finite.Cpp.Sdk + Finite.Cpp.Sdk Visual Studio integration + + + + + + + + + + + + + +