From 50cde4c9c1b835cd24537bf5a585504c1560aeed Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Mon, 21 Dec 2020 21:37:11 +0000 Subject: [PATCH 01/11] (GH-123) Add publishing manifest file To be used in conjunction with the VsixPublisher.exe. This file was used for the publishing of the 0.3.0.0 release. --- extension-manifest.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 extension-manifest.json diff --git a/extension-manifest.json b/extension-manifest.json new file mode 100644 index 0000000..2724f77 --- /dev/null +++ b/extension-manifest.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json.schemastore.org/vsix-publish", + "categories": [ + "build" + ], + "identity": { + "internalName": "CakeforVisualStudio", + "tags": [ + "Build", + "C#", + "Cake" + ] + }, + "overview": "./README.md", + "priceCategory": "free", + "publisher": "vs-publisher-1392591", + "private": false, + "qna": false, + "repo": "https://github.com/cake-build/cake-vs" +} \ No newline at end of file From d6e2d89b5b42523973ca2b978deaf0b99799816a Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Tue, 17 Aug 2021 20:53:10 +0100 Subject: [PATCH 02/11] (#133) Upgrade to support Visual Studio 2022 The work done in this commit is as a result of following along with this article: https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/update-visual-studio-extension?view=vs-2022 There is still work to be done here but this is a good start. --- Cake.VisualStudio.sln | 32 +- .../Cake.VisualStudio.2022.csproj | 320 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 33 ++ .../source.extension.ico | Bin .../source.extension.vsixmanifest | 42 +++ .../source.extension1.cs | 18 + .../Adornments/AdornmentLayer.cs | 0 .../Adornments/AdornmentProvider.cs | 0 .../Adornments/LogoAdornment.cs | 0 .../Cake.VisualStudio.Shared.projitems | 58 ++++ .../Cake.VisualStudio.Shared.shproj | 13 + .../CakePackage.cs | 0 .../CakeClassificationDefinition.cs | 0 .../Classifier/CakeClassifier.cs | 0 .../Classifier/CakeClassifierFormat.cs | 0 .../Classifier/CakeClassifierProvider.cs | 0 .../Classifier/ClassifierNames.cs | 0 .../Classifier/Languages/BaseLanguage.cs | 0 .../Classifier/Languages/CakeLanguage.cs | 0 .../Configuration/BindingParser.cs | 0 .../Configuration/ConfigurationExtensions.cs | 0 .../Configuration/ConfigurationParser.cs | 0 .../Configuration/ToolLocator.cs | 0 .../ContentType/CakeContentTypeDefinition.cs | 0 .../ContentType/CakeLanguageService.cs | 0 .../Editor/CakeDropHandler.cs | 0 .../Editor/CakeScriptDropHandler.cs | 0 .../Editor/CakeScriptDropHandlerProvider.cs | 0 .../Editor/IndentationResult.cs | 0 .../Editor/LineExtensions.cs | 0 .../Editor/SmartIndent.cs | 0 .../Editor/SmartIndentProvider.cs | 0 .../Helpers/Constants.cs | 0 .../Helpers/Extensions.cs | 0 .../Helpers/Logger.cs | 0 .../Helpers/PathHelpers.cs | 0 .../Helpers/ProjectHelpers.cs | 0 .../Menus/InstallConfigFileCommand.cs | 0 ...nstallDotNetCoreBashBootstrapperCommand.cs | 0 ...DotNetCorePowerShellBootstrapperCommand.cs | 0 ...lDotNetFrameworkBashBootstrapperCommand.cs | 0 ...tFrameworkPowerShellBootstrapperCommand.cs | 1 + ...nstallDotNetToolBashBootstrapperCommand.cs | 0 ...DotNetToolPowerShellBootstrapperCommand.cs | 0 .../Menus/MenuHelpers.cs | 0 .../TaskRunner/ScriptContent.cs | 0 .../TaskRunner/TaskParser.cs | 0 .../TaskRunner/TaskRunner.cs | 0 .../TaskRunner/TaskRunnerConfig.cs | 0 .../TaskRunner/TaskRunnerOption.cs | 0 .../Cake.VisualStudio.csproj | 166 ++++----- .../Properties/AssemblyInfo.cs | 0 .../Properties/template-builder.props | 0 src/{ => Cake.VisualStudio}/app.config | 0 .../source.extension.cs | 0 src/Cake.VisualStudio/source.extension.ico | Bin 0 -> 4286 bytes .../source.extension.resx | 0 .../source.extension.vsixmanifest | 0 src/Packages/PackageDescriptor.cs | 35 -- src/Packages/PackageWizard.cs | 82 ----- src/{ => metadata}/FileIcons.imagemanifest | 0 src/{ => metadata}/Resources/CakeFile.png | Bin src/{ => metadata}/Resources/MenuIcons.bmp | Bin src/{ => metadata}/Resources/MenuIcons.pxf | Bin src/{ => metadata}/Resources/TaskRunner.png | Bin src/{ => metadata}/Resources/cake-icon.ico | Bin src/{ => metadata}/Resources/icon.png | Bin src/{ => metadata}/Resources/preview.png | Bin .../Snippets/CSharp/method-alias.snippet | 0 .../Snippets/CSharp/property-alias.snippet | 0 .../Snippets/Cake/argument.snippet | 0 .../Snippets/Cake/cake-task.snippet | 0 src/{ => metadata}/Snippets/snippets.pkgdef | 0 src/{ => metadata}/VsCommandTable.cs | 0 src/{ => metadata}/VsCommandTable.vsct | 0 src/{ => metadata}/icons.pkgdef | 0 76 files changed, 575 insertions(+), 225 deletions(-) create mode 100644 src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj create mode 100644 src/Cake.VisualStudio.2022/Properties/AssemblyInfo.cs rename src/{ => Cake.VisualStudio.2022}/source.extension.ico (100%) create mode 100644 src/Cake.VisualStudio.2022/source.extension.vsixmanifest create mode 100644 src/Cake.VisualStudio.2022/source.extension1.cs rename src/{ => Cake.VisualStudio.Shared}/Adornments/AdornmentLayer.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Adornments/AdornmentProvider.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Adornments/LogoAdornment.cs (100%) create mode 100644 src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems create mode 100644 src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.shproj rename src/{ => Cake.VisualStudio.Shared}/CakePackage.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Classifier/CakeClassificationDefinition.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Classifier/CakeClassifier.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Classifier/CakeClassifierFormat.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Classifier/CakeClassifierProvider.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Classifier/ClassifierNames.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Classifier/Languages/BaseLanguage.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Classifier/Languages/CakeLanguage.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Configuration/BindingParser.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Configuration/ConfigurationExtensions.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Configuration/ConfigurationParser.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Configuration/ToolLocator.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/ContentType/CakeContentTypeDefinition.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/ContentType/CakeLanguageService.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Editor/CakeDropHandler.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Editor/CakeScriptDropHandler.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Editor/CakeScriptDropHandlerProvider.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Editor/IndentationResult.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Editor/LineExtensions.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Editor/SmartIndent.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Editor/SmartIndentProvider.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Helpers/Constants.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Helpers/Extensions.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Helpers/Logger.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Helpers/PathHelpers.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Helpers/ProjectHelpers.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Menus/InstallConfigFileCommand.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Menus/InstallDotNetCoreBashBootstrapperCommand.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs (98%) rename src/{ => Cake.VisualStudio.Shared}/Menus/InstallDotNetToolBashBootstrapperCommand.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/Menus/MenuHelpers.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/TaskRunner/ScriptContent.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/TaskRunner/TaskParser.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/TaskRunner/TaskRunner.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/TaskRunner/TaskRunnerConfig.cs (100%) rename src/{ => Cake.VisualStudio.Shared}/TaskRunner/TaskRunnerOption.cs (100%) rename src/{ => Cake.VisualStudio}/Cake.VisualStudio.csproj (71%) rename src/{ => Cake.VisualStudio}/Properties/AssemblyInfo.cs (100%) rename src/{ => Cake.VisualStudio}/Properties/template-builder.props (100%) rename src/{ => Cake.VisualStudio}/app.config (100%) rename src/{ => Cake.VisualStudio}/source.extension.cs (100%) create mode 100644 src/Cake.VisualStudio/source.extension.ico rename src/{ => Cake.VisualStudio}/source.extension.resx (100%) rename src/{ => Cake.VisualStudio}/source.extension.vsixmanifest (100%) delete mode 100644 src/Packages/PackageDescriptor.cs delete mode 100644 src/Packages/PackageWizard.cs rename src/{ => metadata}/FileIcons.imagemanifest (100%) rename src/{ => metadata}/Resources/CakeFile.png (100%) rename src/{ => metadata}/Resources/MenuIcons.bmp (100%) rename src/{ => metadata}/Resources/MenuIcons.pxf (100%) rename src/{ => metadata}/Resources/TaskRunner.png (100%) rename src/{ => metadata}/Resources/cake-icon.ico (100%) rename src/{ => metadata}/Resources/icon.png (100%) rename src/{ => metadata}/Resources/preview.png (100%) rename src/{ => metadata}/Snippets/CSharp/method-alias.snippet (100%) rename src/{ => metadata}/Snippets/CSharp/property-alias.snippet (100%) rename src/{ => metadata}/Snippets/Cake/argument.snippet (100%) rename src/{ => metadata}/Snippets/Cake/cake-task.snippet (100%) rename src/{ => metadata}/Snippets/snippets.pkgdef (100%) rename src/{ => metadata}/VsCommandTable.cs (100%) rename src/{ => metadata}/VsCommandTable.vsct (100%) rename src/{ => metadata}/icons.pkgdef (100%) diff --git a/Cake.VisualStudio.sln b/Cake.VisualStudio.sln index 854c495..0968a9e 100644 --- a/Cake.VisualStudio.sln +++ b/Cake.VisualStudio.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26127.3 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31515.178 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{04D0CE67-A915-44BB-BC3C-8E7885CF9E97}" ProjectSection(SolutionItems) = preProject @@ -11,11 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{7067556F-B744-4F73-B509-C8CC9F559AB9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.VisualStudio", "src\Cake.VisualStudio.csproj", "{94660BCF-169A-42E1-BD84-345449743069}" - ProjectSection(ProjectDependencies) = postProject - {FCE573DD-E74E-4AB1-9D17-56FC8869797F} = {FCE573DD-E74E-4AB1-9D17-56FC8869797F} - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddinTemplate", "template\AddinTemplate\AddinTemplate.csproj", "{FCE573DD-E74E-4AB1-9D17-56FC8869797F}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleTemplate", "template\ModuleTemplate\ModuleTemplate.csproj", "{85BCBED7-39BD-4670-85F7-EE36D0DA31C0}" @@ -28,16 +23,23 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddinTestBasicTemplate", "t EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionItemTemplate", "template\SolutionItemTemplate\SolutionItemTemplate.csproj", "{5D45E667-D12D-44F8-8A87-5503BF5DE274}" EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Cake.VisualStudio.Shared", "src\Cake.VisualStudio.Shared\Cake.VisualStudio.Shared.shproj", "{3D9AB2DB-3DD8-4E2B-8DBC-BF29EDAF1A1B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.VisualStudio", "src\Cake.VisualStudio\Cake.VisualStudio.csproj", "{94660BCF-169A-42E1-BD84-345449743069}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.VisualStudio.2022", "src\Cake.VisualStudio.2022\Cake.VisualStudio.2022.csproj", "{F8EB885A-FCA3-410A-B895-9CE327D5D482}" +EndProject Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + src\Cake.VisualStudio.Shared\Cake.VisualStudio.Shared.projitems*{3d9ab2db-3dd8-4e2b-8dbc-bf29edaf1a1b}*SharedItemsImports = 13 + src\Cake.VisualStudio.Shared\Cake.VisualStudio.Shared.projitems*{94660bcf-169a-42e1-bd84-345449743069}*SharedItemsImports = 4 + src\Cake.VisualStudio.Shared\Cake.VisualStudio.Shared.projitems*{f8eb885a-fca3-410a-b895-9ce327d5d482}*SharedItemsImports = 4 + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {94660BCF-169A-42E1-BD84-345449743069}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94660BCF-169A-42E1-BD84-345449743069}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94660BCF-169A-42E1-BD84-345449743069}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94660BCF-169A-42E1-BD84-345449743069}.Release|Any CPU.Build.0 = Release|Any CPU {FCE573DD-E74E-4AB1-9D17-56FC8869797F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FCE573DD-E74E-4AB1-9D17-56FC8869797F}.Debug|Any CPU.Build.0 = Debug|Any CPU {FCE573DD-E74E-4AB1-9D17-56FC8869797F}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -62,6 +64,14 @@ Global {5D45E667-D12D-44F8-8A87-5503BF5DE274}.Debug|Any CPU.Build.0 = Debug|Any CPU {5D45E667-D12D-44F8-8A87-5503BF5DE274}.Release|Any CPU.ActiveCfg = Release|Any CPU {5D45E667-D12D-44F8-8A87-5503BF5DE274}.Release|Any CPU.Build.0 = Release|Any CPU + {94660BCF-169A-42E1-BD84-345449743069}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94660BCF-169A-42E1-BD84-345449743069}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94660BCF-169A-42E1-BD84-345449743069}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94660BCF-169A-42E1-BD84-345449743069}.Release|Any CPU.Build.0 = Release|Any CPU + {F8EB885A-FCA3-410A-B895-9CE327D5D482}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8EB885A-FCA3-410A-B895-9CE327D5D482}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8EB885A-FCA3-410A-B895-9CE327D5D482}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8EB885A-FCA3-410A-B895-9CE327D5D482}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj new file mode 100644 index 0000000..846bdc9 --- /dev/null +++ b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj @@ -0,0 +1,320 @@ + + + + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + Program + $(DevEnvDir)\devenv.exe + /rootsuffix Exp + + + + Debug + AnyCPU + 2.0 + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {F8EB885A-FCA3-410A-B895-9CE327D5D482} + Library + Properties + Cake.VisualStudio + Cake.VisualStudio + v4.7.2 + true + true + true + true + true + false + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + $([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\..\packages\TemplateBuilder.1.1.4.5-beta\tools\ligershark.templates.targets )) + + + + VsCommandTable.cs + True + True + VsCommandTable.vsct + + + + True + True + source.extension.vsixmanifest + + + + + Resources\LICENSE + true + + + icons.pkgdef + + + Resources\cake-icon.ico + true + + + Resources\CakeFile.png + true + + + Resources\icon.png + true + + + Resources\MenuIcons.bmp + true + + + Resources\preview.png + true + + + Resources\TaskRunner.png + true + + + Snippets\snippets.pkgdef + + + VsCommandTable.vsct + VsctGenerator + VsCommandTable.cs + + + source.extension.vsixmanifest + + + FileIcons.imagemanifest + + + Snippets\Cake\argument.snippet + true + + + Snippets\Cake\cake-task.snippet + true + + + Snippets\CSharp\method-alias.snippet + true + + + Snippets\CSharp\property-alias.snippet + true + + + true + Packages + Always + false + + + true + Packages + Always + false + + + true + Packages + Always + false + + + true + Packages + Always + false + + + true + Packages + Always + false + + + true + Packages + Always + false + + + true + Packages + Always + false + + + true + Packages + Always + false + + + true + Packages + Always + false + + + + Designer + VsixManifestGenerator + source.extension1.cs + + + + + + + + + + + + + + + + + + + + + + + {FCE573DD-E74E-4AB1-9D17-56FC8869797F} + AddinTemplate + ProjectTemplates + false + TemplateProjectOutputGroup%3b + + + {F21E9BF8-745B-4B29-B113-0E55AE840D24} + AddinTestBasicTemplate + ProjectTemplates + false + TemplateProjectOutputGroup%3b + + + {AB983284-D1F6-4853-9462-402F2985A141} + AddinTestTemplate + ProjectTemplates + false + TemplateProjectOutputGroup%3b + + + {c27ab61e-d245-4a8c-abd1-53313e388509} + ItemTemplate + ItemTemplates + false + TemplateProjectOutputGroup%3b + + + {85BCBED7-39BD-4670-85F7-EE36D0DA31C0} + ModuleTemplate + ProjectTemplates + false + TemplateProjectOutputGroup%3b + + + {5D45E667-D12D-44F8-8A87-5503BF5DE274} + SolutionItemTemplate + ItemTemplates + false + TemplateProjectOutputGroup%3b + + + + + False + .NET Framework 3.5 SP1 + false + + + + + 0.38.5 + + + 2.5.2 + + + 17.0.0-previews-2-31512-422 + + + 17.0.0-previews-2-31512-422 + + + 16.10.1 + + + 17.0.2155-preview2 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 1.1.6.1 + + + 2.4.1 + + + 2.4.3 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + \ No newline at end of file diff --git a/src/Cake.VisualStudio.2022/Properties/AssemblyInfo.cs b/src/Cake.VisualStudio.2022/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3d111d2 --- /dev/null +++ b/src/Cake.VisualStudio.2022/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Cake.VisualStudio._2022")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Cake.VisualStudio._2022")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/source.extension.ico b/src/Cake.VisualStudio.2022/source.extension.ico similarity index 100% rename from src/source.extension.ico rename to src/Cake.VisualStudio.2022/source.extension.ico diff --git a/src/Cake.VisualStudio.2022/source.extension.vsixmanifest b/src/Cake.VisualStudio.2022/source.extension.vsixmanifest new file mode 100644 index 0000000..74a2f47 --- /dev/null +++ b/src/Cake.VisualStudio.2022/source.extension.vsixmanifest @@ -0,0 +1,42 @@ + + + + + Cake for Visual Studio 2022 + Adds support for the Cake build tool in Visual Studio 2022. Includes support for the Task Runner Explorer, new templates and bootstrapping important Cake files. + https://github.com/cake-build/cake-vs + Resources\LICENSE + Resources\icon.png + Resources\preview.png + cake, build + + + + amd64 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Cake.VisualStudio.2022/source.extension1.cs b/src/Cake.VisualStudio.2022/source.extension1.cs new file mode 100644 index 0000000..8ce9e65 --- /dev/null +++ b/src/Cake.VisualStudio.2022/source.extension1.cs @@ -0,0 +1,18 @@ +// ------------------------------------------------------------------------------ +// +// This file was generated by VSIX Synchronizer +// +// ------------------------------------------------------------------------------ +namespace Cake.VisualStudio +{ + internal sealed partial class Vsix + { + public const string Id = "3cf9b016-d63f-44ee-849d-6f3efc996134"; + public const string Name = "Cake for Visual Studio 2022"; + public const string Description = @"Adds support for the Cake build tool in Visual Studio 2022. Includes support for the Task Runner Explorer, new templates and bootstrapping important Cake files."; + public const string Language = "en-US"; + public const string Version = "1.0"; + public const string Author = "Gary Ewan Park"; + public const string Tags = "cake, build"; + } +} diff --git a/src/Adornments/AdornmentLayer.cs b/src/Cake.VisualStudio.Shared/Adornments/AdornmentLayer.cs similarity index 100% rename from src/Adornments/AdornmentLayer.cs rename to src/Cake.VisualStudio.Shared/Adornments/AdornmentLayer.cs diff --git a/src/Adornments/AdornmentProvider.cs b/src/Cake.VisualStudio.Shared/Adornments/AdornmentProvider.cs similarity index 100% rename from src/Adornments/AdornmentProvider.cs rename to src/Cake.VisualStudio.Shared/Adornments/AdornmentProvider.cs diff --git a/src/Adornments/LogoAdornment.cs b/src/Cake.VisualStudio.Shared/Adornments/LogoAdornment.cs similarity index 100% rename from src/Adornments/LogoAdornment.cs rename to src/Cake.VisualStudio.Shared/Adornments/LogoAdornment.cs diff --git a/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems new file mode 100644 index 0000000..35a36c1 --- /dev/null +++ b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems @@ -0,0 +1,58 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 3d9ab2db-3dd8-4e2b-8dbc-bf29edaf1a1b + + + Cake.VisualStudio.Shared + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.shproj b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.shproj new file mode 100644 index 0000000..167e6c4 --- /dev/null +++ b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.shproj @@ -0,0 +1,13 @@ + + + + 3d9ab2db-3dd8-4e2b-8dbc-bf29edaf1a1b + 14.0 + + + + + + + + diff --git a/src/CakePackage.cs b/src/Cake.VisualStudio.Shared/CakePackage.cs similarity index 100% rename from src/CakePackage.cs rename to src/Cake.VisualStudio.Shared/CakePackage.cs diff --git a/src/Classifier/CakeClassificationDefinition.cs b/src/Cake.VisualStudio.Shared/Classifier/CakeClassificationDefinition.cs similarity index 100% rename from src/Classifier/CakeClassificationDefinition.cs rename to src/Cake.VisualStudio.Shared/Classifier/CakeClassificationDefinition.cs diff --git a/src/Classifier/CakeClassifier.cs b/src/Cake.VisualStudio.Shared/Classifier/CakeClassifier.cs similarity index 100% rename from src/Classifier/CakeClassifier.cs rename to src/Cake.VisualStudio.Shared/Classifier/CakeClassifier.cs diff --git a/src/Classifier/CakeClassifierFormat.cs b/src/Cake.VisualStudio.Shared/Classifier/CakeClassifierFormat.cs similarity index 100% rename from src/Classifier/CakeClassifierFormat.cs rename to src/Cake.VisualStudio.Shared/Classifier/CakeClassifierFormat.cs diff --git a/src/Classifier/CakeClassifierProvider.cs b/src/Cake.VisualStudio.Shared/Classifier/CakeClassifierProvider.cs similarity index 100% rename from src/Classifier/CakeClassifierProvider.cs rename to src/Cake.VisualStudio.Shared/Classifier/CakeClassifierProvider.cs diff --git a/src/Classifier/ClassifierNames.cs b/src/Cake.VisualStudio.Shared/Classifier/ClassifierNames.cs similarity index 100% rename from src/Classifier/ClassifierNames.cs rename to src/Cake.VisualStudio.Shared/Classifier/ClassifierNames.cs diff --git a/src/Classifier/Languages/BaseLanguage.cs b/src/Cake.VisualStudio.Shared/Classifier/Languages/BaseLanguage.cs similarity index 100% rename from src/Classifier/Languages/BaseLanguage.cs rename to src/Cake.VisualStudio.Shared/Classifier/Languages/BaseLanguage.cs diff --git a/src/Classifier/Languages/CakeLanguage.cs b/src/Cake.VisualStudio.Shared/Classifier/Languages/CakeLanguage.cs similarity index 100% rename from src/Classifier/Languages/CakeLanguage.cs rename to src/Cake.VisualStudio.Shared/Classifier/Languages/CakeLanguage.cs diff --git a/src/Configuration/BindingParser.cs b/src/Cake.VisualStudio.Shared/Configuration/BindingParser.cs similarity index 100% rename from src/Configuration/BindingParser.cs rename to src/Cake.VisualStudio.Shared/Configuration/BindingParser.cs diff --git a/src/Configuration/ConfigurationExtensions.cs b/src/Cake.VisualStudio.Shared/Configuration/ConfigurationExtensions.cs similarity index 100% rename from src/Configuration/ConfigurationExtensions.cs rename to src/Cake.VisualStudio.Shared/Configuration/ConfigurationExtensions.cs diff --git a/src/Configuration/ConfigurationParser.cs b/src/Cake.VisualStudio.Shared/Configuration/ConfigurationParser.cs similarity index 100% rename from src/Configuration/ConfigurationParser.cs rename to src/Cake.VisualStudio.Shared/Configuration/ConfigurationParser.cs diff --git a/src/Configuration/ToolLocator.cs b/src/Cake.VisualStudio.Shared/Configuration/ToolLocator.cs similarity index 100% rename from src/Configuration/ToolLocator.cs rename to src/Cake.VisualStudio.Shared/Configuration/ToolLocator.cs diff --git a/src/ContentType/CakeContentTypeDefinition.cs b/src/Cake.VisualStudio.Shared/ContentType/CakeContentTypeDefinition.cs similarity index 100% rename from src/ContentType/CakeContentTypeDefinition.cs rename to src/Cake.VisualStudio.Shared/ContentType/CakeContentTypeDefinition.cs diff --git a/src/ContentType/CakeLanguageService.cs b/src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs similarity index 100% rename from src/ContentType/CakeLanguageService.cs rename to src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs diff --git a/src/Editor/CakeDropHandler.cs b/src/Cake.VisualStudio.Shared/Editor/CakeDropHandler.cs similarity index 100% rename from src/Editor/CakeDropHandler.cs rename to src/Cake.VisualStudio.Shared/Editor/CakeDropHandler.cs diff --git a/src/Editor/CakeScriptDropHandler.cs b/src/Cake.VisualStudio.Shared/Editor/CakeScriptDropHandler.cs similarity index 100% rename from src/Editor/CakeScriptDropHandler.cs rename to src/Cake.VisualStudio.Shared/Editor/CakeScriptDropHandler.cs diff --git a/src/Editor/CakeScriptDropHandlerProvider.cs b/src/Cake.VisualStudio.Shared/Editor/CakeScriptDropHandlerProvider.cs similarity index 100% rename from src/Editor/CakeScriptDropHandlerProvider.cs rename to src/Cake.VisualStudio.Shared/Editor/CakeScriptDropHandlerProvider.cs diff --git a/src/Editor/IndentationResult.cs b/src/Cake.VisualStudio.Shared/Editor/IndentationResult.cs similarity index 100% rename from src/Editor/IndentationResult.cs rename to src/Cake.VisualStudio.Shared/Editor/IndentationResult.cs diff --git a/src/Editor/LineExtensions.cs b/src/Cake.VisualStudio.Shared/Editor/LineExtensions.cs similarity index 100% rename from src/Editor/LineExtensions.cs rename to src/Cake.VisualStudio.Shared/Editor/LineExtensions.cs diff --git a/src/Editor/SmartIndent.cs b/src/Cake.VisualStudio.Shared/Editor/SmartIndent.cs similarity index 100% rename from src/Editor/SmartIndent.cs rename to src/Cake.VisualStudio.Shared/Editor/SmartIndent.cs diff --git a/src/Editor/SmartIndentProvider.cs b/src/Cake.VisualStudio.Shared/Editor/SmartIndentProvider.cs similarity index 100% rename from src/Editor/SmartIndentProvider.cs rename to src/Cake.VisualStudio.Shared/Editor/SmartIndentProvider.cs diff --git a/src/Helpers/Constants.cs b/src/Cake.VisualStudio.Shared/Helpers/Constants.cs similarity index 100% rename from src/Helpers/Constants.cs rename to src/Cake.VisualStudio.Shared/Helpers/Constants.cs diff --git a/src/Helpers/Extensions.cs b/src/Cake.VisualStudio.Shared/Helpers/Extensions.cs similarity index 100% rename from src/Helpers/Extensions.cs rename to src/Cake.VisualStudio.Shared/Helpers/Extensions.cs diff --git a/src/Helpers/Logger.cs b/src/Cake.VisualStudio.Shared/Helpers/Logger.cs similarity index 100% rename from src/Helpers/Logger.cs rename to src/Cake.VisualStudio.Shared/Helpers/Logger.cs diff --git a/src/Helpers/PathHelpers.cs b/src/Cake.VisualStudio.Shared/Helpers/PathHelpers.cs similarity index 100% rename from src/Helpers/PathHelpers.cs rename to src/Cake.VisualStudio.Shared/Helpers/PathHelpers.cs diff --git a/src/Helpers/ProjectHelpers.cs b/src/Cake.VisualStudio.Shared/Helpers/ProjectHelpers.cs similarity index 100% rename from src/Helpers/ProjectHelpers.cs rename to src/Cake.VisualStudio.Shared/Helpers/ProjectHelpers.cs diff --git a/src/Menus/InstallConfigFileCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallConfigFileCommand.cs similarity index 100% rename from src/Menus/InstallConfigFileCommand.cs rename to src/Cake.VisualStudio.Shared/Menus/InstallConfigFileCommand.cs diff --git a/src/Menus/InstallDotNetCoreBashBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetCoreBashBootstrapperCommand.cs similarity index 100% rename from src/Menus/InstallDotNetCoreBashBootstrapperCommand.cs rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetCoreBashBootstrapperCommand.cs diff --git a/src/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs similarity index 100% rename from src/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs diff --git a/src/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs similarity index 100% rename from src/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs diff --git a/src/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs similarity index 98% rename from src/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs index 6028e89..0d779cd 100644 --- a/src/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs +++ b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs @@ -87,6 +87,7 @@ public static void Initialize(Package package) /// Event args. private void MenuItemCallback(object sender, EventArgs e) { + ThreadHelper.ThrowIfNotOnUIThread(); var dte = CakePackage.Dte; if (dte == null) diff --git a/src/Menus/InstallDotNetToolBashBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetToolBashBootstrapperCommand.cs similarity index 100% rename from src/Menus/InstallDotNetToolBashBootstrapperCommand.cs rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetToolBashBootstrapperCommand.cs diff --git a/src/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs similarity index 100% rename from src/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs diff --git a/src/Menus/MenuHelpers.cs b/src/Cake.VisualStudio.Shared/Menus/MenuHelpers.cs similarity index 100% rename from src/Menus/MenuHelpers.cs rename to src/Cake.VisualStudio.Shared/Menus/MenuHelpers.cs diff --git a/src/TaskRunner/ScriptContent.cs b/src/Cake.VisualStudio.Shared/TaskRunner/ScriptContent.cs similarity index 100% rename from src/TaskRunner/ScriptContent.cs rename to src/Cake.VisualStudio.Shared/TaskRunner/ScriptContent.cs diff --git a/src/TaskRunner/TaskParser.cs b/src/Cake.VisualStudio.Shared/TaskRunner/TaskParser.cs similarity index 100% rename from src/TaskRunner/TaskParser.cs rename to src/Cake.VisualStudio.Shared/TaskRunner/TaskParser.cs diff --git a/src/TaskRunner/TaskRunner.cs b/src/Cake.VisualStudio.Shared/TaskRunner/TaskRunner.cs similarity index 100% rename from src/TaskRunner/TaskRunner.cs rename to src/Cake.VisualStudio.Shared/TaskRunner/TaskRunner.cs diff --git a/src/TaskRunner/TaskRunnerConfig.cs b/src/Cake.VisualStudio.Shared/TaskRunner/TaskRunnerConfig.cs similarity index 100% rename from src/TaskRunner/TaskRunnerConfig.cs rename to src/Cake.VisualStudio.Shared/TaskRunner/TaskRunnerConfig.cs diff --git a/src/TaskRunner/TaskRunnerOption.cs b/src/Cake.VisualStudio.Shared/TaskRunner/TaskRunnerOption.cs similarity index 100% rename from src/TaskRunner/TaskRunnerOption.cs rename to src/Cake.VisualStudio.Shared/TaskRunner/TaskRunnerOption.cs diff --git a/src/Cake.VisualStudio.csproj b/src/Cake.VisualStudio/Cake.VisualStudio.csproj similarity index 71% rename from src/Cake.VisualStudio.csproj rename to src/Cake.VisualStudio/Cake.VisualStudio.csproj index 9dd7dbd..1ace168 100644 --- a/src/Cake.VisualStudio.csproj +++ b/src/Cake.VisualStudio/Cake.VisualStudio.csproj @@ -68,144 +68,135 @@ $([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\..\packages\TemplateBuilder.1.1.4.5-beta\tools\ligershark.templates.targets )) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - source.extension.vsixmanifest - - - - - + + VsCommandTable.cs True True VsCommandTable.vsct - - - + + source.extension.vsixmanifest + - - - + Resources\LICENSE true - - Always + + icons.pkgdef + + + Resources\cake-icon.ico + true + + + Resources\CakeFile.png + true + + + Resources\icon.png + true + + + Resources\MenuIcons.bmp true - + + Resources\preview.png true - - - + + Resources\TaskRunner.png true + + Snippets\snippets.pkgdef + + + VsCommandTable.vsct + VsctGenerator + VsCommandTable.cs + source.extension.vsixmanifest - + + FileIcons.imagemanifest + + + Snippets\Cake\argument.snippet + true + + + Snippets\Cake\cake-task.snippet + true + + + Snippets\CSharp\method-alias.snippet + true + + + Snippets\CSharp\property-alias.snippet true - Designer - + true Packages Always false - + true Packages Always false - + true Packages Always false - + true Packages Always false - + true Packages Always false - + true Packages Always false - + true Packages Always false - + true Packages Always false - + true Packages Always false - - - - - Designer - Designer VsixManifestGenerator @@ -229,24 +220,6 @@ - - - Menus.ctmenu - VsctGenerator - VsCommandTable.cs - Designer - - - true - Always - - - true - - - true - - True @@ -256,46 +229,44 @@ VSPackage + - - - - + {FCE573DD-E74E-4AB1-9D17-56FC8869797F} AddinTemplate ProjectTemplates false TemplateProjectOutputGroup%3b - + {F21E9BF8-745B-4B29-B113-0E55AE840D24} AddinTestBasicTemplate ProjectTemplates false TemplateProjectOutputGroup%3b - + {AB983284-D1F6-4853-9462-402F2985A141} AddinTestTemplate ProjectTemplates false TemplateProjectOutputGroup%3b - + {c27ab61e-d245-4a8c-abd1-53313e388509} ItemTemplate ItemTemplates false TemplateProjectOutputGroup%3b - + {85BCBED7-39BD-4670-85F7-EE36D0DA31C0} ModuleTemplate ProjectTemplates false TemplateProjectOutputGroup%3b - + {5D45E667-D12D-44F8-8A87-5503BF5DE274} SolutionItemTemplate ItemTemplates @@ -335,6 +306,7 @@ all + diff --git a/src/Properties/AssemblyInfo.cs b/src/Cake.VisualStudio/Properties/AssemblyInfo.cs similarity index 100% rename from src/Properties/AssemblyInfo.cs rename to src/Cake.VisualStudio/Properties/AssemblyInfo.cs diff --git a/src/Properties/template-builder.props b/src/Cake.VisualStudio/Properties/template-builder.props similarity index 100% rename from src/Properties/template-builder.props rename to src/Cake.VisualStudio/Properties/template-builder.props diff --git a/src/app.config b/src/Cake.VisualStudio/app.config similarity index 100% rename from src/app.config rename to src/Cake.VisualStudio/app.config diff --git a/src/source.extension.cs b/src/Cake.VisualStudio/source.extension.cs similarity index 100% rename from src/source.extension.cs rename to src/Cake.VisualStudio/source.extension.cs diff --git a/src/Cake.VisualStudio/source.extension.ico b/src/Cake.VisualStudio/source.extension.ico new file mode 100644 index 0000000000000000000000000000000000000000..d844c1a28f3e01f9786ffdb8451f9554607648a5 GIT binary patch literal 4286 zcmchadrVVT9LEm@T2Lnr6=*56yrd{Tc#nq#DW%d@9+}x@bR#j=%w@~6b!ORSOg6;0WQlVbo7wQ$@6Nf5(o1g@jqEhP-h0nI z_kMogbAG>b&mkm){?uy1{>ktnLShIZ8fvtPlu={#tn8up{_pZwij9QDn@L218PfP_ zL?m)^?m~KD7YSF^kWhIwmZqDLUuHvv*@1Fn6B1X}V4k`*z=zN{J;LHDiA+&J9#@qT ztyUY*W;PYFL<^BnE{QcFGSLKmO$+MVcEH}Ti#HwDg>a=g@Kq^xkg{h%^7}wCI}wuF z2np@4(75#olN%5&uOtzQa-vKt4t$o@EKIE0>h=^tK*^)A0x> znr0CDp&51%#Ihem|2#;^(;(SBAQ~4WY8xcfuh2LH^Nn&%BqYuxU`HmHP-W{Buo*u& zw+V|i_5eH)<GeNq@|gDNerIe${Z>e6T!@wjI!`wWwn4SX@RIiOPTA{tu#`X*bli2WXe)xj>e; z&pCft4%6Nz;OnegK(zgQUd^R`nbL$xu1&yZaTk-@3erGxiRSfO^3!rS*jz&G>nxk; zyz<;+Ue6(4%4=^8(7q(6ZBjdnmpSC8W;5-*0>0L~38Z{rdQQ6sKdPh$1;algeC z4t|2DZSO$hcx(FEsd%4xr1>w6r}MnUC1A60k7nBa+f#nX;u6vPi_!0da|{A=jC#R& z{(^4g3i6J956x?zBYxl%7WNE7(sX$8-ISk_Wr4LtsJ+Cr5u{>Jz*qIY&3{kC91!Er z^vD0&F?tu4Z~jD#t`8M8LhTJy`=V@`>;Bs5x%T6qL1GMe6#OY)R&Cf#wQm>neNj~x zau1xrnj;=0?>mDfPacP~^$6vU2IVg@p= zeHS#&y`s;u@eHOvT&^budq1vT8^`bC*WtNv8K=&VV(9#3yzf}XHKJz^opN$Dy`=sQz;VaKY1S@yFz}4Hp$fax8JaiU$*6H;{efv&m zT3!swz8|0Y5UD673z952bo69^3lleP;^l)MpwhY>S=t6z9KvxgtLeh({vqu61vqyd zI5Fp_mL69wz)QElG@ z7UL|({ms&}1({D+(f{U$0lu?}_fMRIBvw5BC&|KpsX|Zk4BIi{_8=wOO4m~zV13M( ztIJxERo;d|8tX;IF0i;`^_+7nG7D`ucHAxS;q+(c5tVAi0%fTXa-XZncpV8>7*SQX z(Wlkw+5vUW1}IiGKuOm$iCK-ld(4Mg>cdlmhk5?3+jsENtMAgaa5d&D%kD!Hzb#c( zBUk65dEN&bUDvSVRKHuCy{PrOX7%g1ZhZ9VmpJ;~X{=bgiC;Ubmy55P#fidN`6?$- zuc_skj92X(K+iL;BfYR0#`-RwFH=6nuBb;`W+T5go~KwVeAz=>u|35aZ4=MQC~ko& zyP5YPEyoJZvDL@7(Q!$l>+6UFBPrJE9)cwP2-`1dO&#Ex`{>?@0)84`Z12CxAE3ej literal 0 HcmV?d00001 diff --git a/src/source.extension.resx b/src/Cake.VisualStudio/source.extension.resx similarity index 100% rename from src/source.extension.resx rename to src/Cake.VisualStudio/source.extension.resx diff --git a/src/source.extension.vsixmanifest b/src/Cake.VisualStudio/source.extension.vsixmanifest similarity index 100% rename from src/source.extension.vsixmanifest rename to src/Cake.VisualStudio/source.extension.vsixmanifest diff --git a/src/Packages/PackageDescriptor.cs b/src/Packages/PackageDescriptor.cs deleted file mode 100644 index cf63b9b..0000000 --- a/src/Packages/PackageDescriptor.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using System.Xml.XPath; - -namespace Cake.VisualStudio.Packages -{ - class PackageDescriptor - { - public PackageDescriptor() - { - - } - - public PackageDescriptor(string id, string version, string source = "http://nuget.org/api/v2") - { - Id = id; - Version = version; - Source = source; - } - internal string Id { get; set; } - internal string Version { get; set; } - internal string Source { get; set; } = "http://nuget.org/api/v2"; - - internal static IEnumerable ParseAllFromXml(string xml) - { - var doc = XDocument.Parse(xml); - var packages = doc.XPathSelectElements("//package"); - return packages.Select(p => new PackageDescriptor(p.Attribute("id").Value, p.Attribute("version").Value)); - } - } -} diff --git a/src/Packages/PackageWizard.cs b/src/Packages/PackageWizard.cs deleted file mode 100644 index c20d508..0000000 --- a/src/Packages/PackageWizard.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; -using Cake.VisualStudio.Helpers; -using EnvDTE; -using Microsoft.VisualStudio.ComponentModelHost; -using Microsoft.VisualStudio.OLE.Interop; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.TemplateWizard; -using NuGet.VisualStudio; - -namespace Cake.VisualStudio.Packages -{ - public sealed class PackageWizard : IWizard - { - [Import] - internal IVsTemplateWizard Wizard { get; set; } - - [Import] - internal IVsPackageInstaller PackageInstaller { get; set; } - - public void RunStarted(object automationObject, Dictionary replacementsDictionary, WizardRunKind runKind, object[] customParams) - { - if (runKind == WizardRunKind.AsNewProject) - { - using (var serviceProvider = new ServiceProvider((IServiceProvider)automationObject)) - { - var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel)); - using (var container = new CompositionContainer(componentModel.DefaultExportProvider)) - { - container.ComposeParts(this); - } - } - - if (PackageInstaller == null) - { - //MessageBox.Show("NuGet Package Manager not available."); - - throw new WizardBackoutException("NuGet Package Manager not available."); - } - ParameterData = replacementsDictionary["$WizardData%"]; - } - Wizard.RunStarted(automationObject, replacementsDictionary, runKind, customParams); - } - - private string ParameterData { get; set; } - - public void ProjectFinishedGenerating(Project project) - { - var packages = PackageDescriptor.ParseAllFromXml(ParameterData); - if (PackageInstaller != null) - { - foreach (var package in packages) - { - CakePackage.Dte.ShowStatusBarText($"Installing NuGet package {package.Id}.{package.Version}"); - PackageInstaller.InstallPackage(package.Source, project, package.Id, package.Version, true); - } - } - Wizard.ProjectFinishedGenerating(project); - } - - public void ProjectItemFinishedGenerating(ProjectItem projectItem) - { - Wizard.ProjectItemFinishedGenerating(projectItem); - } - - public bool ShouldAddProjectItem(string filePath) - { - return Wizard.ShouldAddProjectItem(filePath); - } - - public void BeforeOpeningFile(ProjectItem projectItem) - { - Wizard.BeforeOpeningFile(projectItem); - } - - public void RunFinished() - { - Wizard.RunFinished(); - } - } -} diff --git a/src/FileIcons.imagemanifest b/src/metadata/FileIcons.imagemanifest similarity index 100% rename from src/FileIcons.imagemanifest rename to src/metadata/FileIcons.imagemanifest diff --git a/src/Resources/CakeFile.png b/src/metadata/Resources/CakeFile.png similarity index 100% rename from src/Resources/CakeFile.png rename to src/metadata/Resources/CakeFile.png diff --git a/src/Resources/MenuIcons.bmp b/src/metadata/Resources/MenuIcons.bmp similarity index 100% rename from src/Resources/MenuIcons.bmp rename to src/metadata/Resources/MenuIcons.bmp diff --git a/src/Resources/MenuIcons.pxf b/src/metadata/Resources/MenuIcons.pxf similarity index 100% rename from src/Resources/MenuIcons.pxf rename to src/metadata/Resources/MenuIcons.pxf diff --git a/src/Resources/TaskRunner.png b/src/metadata/Resources/TaskRunner.png similarity index 100% rename from src/Resources/TaskRunner.png rename to src/metadata/Resources/TaskRunner.png diff --git a/src/Resources/cake-icon.ico b/src/metadata/Resources/cake-icon.ico similarity index 100% rename from src/Resources/cake-icon.ico rename to src/metadata/Resources/cake-icon.ico diff --git a/src/Resources/icon.png b/src/metadata/Resources/icon.png similarity index 100% rename from src/Resources/icon.png rename to src/metadata/Resources/icon.png diff --git a/src/Resources/preview.png b/src/metadata/Resources/preview.png similarity index 100% rename from src/Resources/preview.png rename to src/metadata/Resources/preview.png diff --git a/src/Snippets/CSharp/method-alias.snippet b/src/metadata/Snippets/CSharp/method-alias.snippet similarity index 100% rename from src/Snippets/CSharp/method-alias.snippet rename to src/metadata/Snippets/CSharp/method-alias.snippet diff --git a/src/Snippets/CSharp/property-alias.snippet b/src/metadata/Snippets/CSharp/property-alias.snippet similarity index 100% rename from src/Snippets/CSharp/property-alias.snippet rename to src/metadata/Snippets/CSharp/property-alias.snippet diff --git a/src/Snippets/Cake/argument.snippet b/src/metadata/Snippets/Cake/argument.snippet similarity index 100% rename from src/Snippets/Cake/argument.snippet rename to src/metadata/Snippets/Cake/argument.snippet diff --git a/src/Snippets/Cake/cake-task.snippet b/src/metadata/Snippets/Cake/cake-task.snippet similarity index 100% rename from src/Snippets/Cake/cake-task.snippet rename to src/metadata/Snippets/Cake/cake-task.snippet diff --git a/src/Snippets/snippets.pkgdef b/src/metadata/Snippets/snippets.pkgdef similarity index 100% rename from src/Snippets/snippets.pkgdef rename to src/metadata/Snippets/snippets.pkgdef diff --git a/src/VsCommandTable.cs b/src/metadata/VsCommandTable.cs similarity index 100% rename from src/VsCommandTable.cs rename to src/metadata/VsCommandTable.cs diff --git a/src/VsCommandTable.vsct b/src/metadata/VsCommandTable.vsct similarity index 100% rename from src/VsCommandTable.vsct rename to src/metadata/VsCommandTable.vsct diff --git a/src/icons.pkgdef b/src/metadata/icons.pkgdef similarity index 100% rename from src/icons.pkgdef rename to src/metadata/icons.pkgdef From 2900bc19708396a34b7773d31c3f5ce9fd0584e1 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Wed, 18 Aug 2021 12:11:24 +0200 Subject: [PATCH 03/11] (#133) enabled Build -> Cake Build menu By setting the build action to VSCTCompile in 2022, as it is in 2019. --- .../Cake.VisualStudio.2022.csproj | 5 +- .../Cake.VisualStudio.csproj | 18 +-- src/Cake.VisualStudio/source.extension.resx | 130 ------------------ 3 files changed, 10 insertions(+), 143 deletions(-) delete mode 100644 src/Cake.VisualStudio/source.extension.resx diff --git a/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj index 846bdc9..ca2e868 100644 --- a/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj +++ b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj @@ -116,11 +116,12 @@ Snippets\snippets.pkgdef - + VsCommandTable.vsct + Menus.ctmenu VsctGenerator VsCommandTable.cs - + source.extension.vsixmanifest diff --git a/src/Cake.VisualStudio/Cake.VisualStudio.csproj b/src/Cake.VisualStudio/Cake.VisualStudio.csproj index 1ace168..b5204ca 100644 --- a/src/Cake.VisualStudio/Cake.VisualStudio.csproj +++ b/src/Cake.VisualStudio/Cake.VisualStudio.csproj @@ -76,6 +76,8 @@ source.extension.vsixmanifest + True + True @@ -86,6 +88,7 @@ icons.pkgdef + true Resources\cake-icon.ico @@ -113,11 +116,13 @@ Snippets\snippets.pkgdef + true VsCommandTable.vsct + Menus.ctmenu VsctGenerator - VsCommandTable.cs + ..\metadata\VsCommandTable.cs source.extension.vsixmanifest @@ -200,7 +205,7 @@ Designer VsixManifestGenerator - source.extension.resx + source.extension.cs @@ -220,15 +225,6 @@ - - - True - True - source.extension.vsixmanifest - true - VSPackage - - diff --git a/src/Cake.VisualStudio/source.extension.resx b/src/Cake.VisualStudio/source.extension.resx deleted file mode 100644 index 02682c4..0000000 --- a/src/Cake.VisualStudio/source.extension.resx +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Cake for Visual Studio - - - Adds support for the Cake build tool in Visual Studio 2017 and 2019. Includes support for the Task Runner Explorer, new templates and bootstrapping important Cake files. - - - - source.extension.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file From 6767ba764acccaf58f3ddbb60f285ae5cfcc7572 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Wed, 18 Aug 2021 22:49:59 +0200 Subject: [PATCH 04/11] (#133) re-enabled CSharp snippets --- .../Cake.VisualStudio.2022.csproj | 9 +++++---- .../source.extension.vsixmanifest | 4 ++-- src/Cake.VisualStudio.2022/source.extension1.cs | 4 ++-- src/Cake.VisualStudio/Cake.VisualStudio.csproj | 13 +++++++++---- src/Cake.VisualStudio/source.extension.cs | 4 ++-- .../{CSharp => Cake-Addin}/method-alias.snippet | 0 .../{CSharp => Cake-Addin}/property-alias.snippet | 0 src/metadata/Snippets/snippets.pkgdef | 4 ++-- 8 files changed, 22 insertions(+), 16 deletions(-) rename src/metadata/Snippets/{CSharp => Cake-Addin}/method-alias.snippet (100%) rename src/metadata/Snippets/{CSharp => Cake-Addin}/property-alias.snippet (100%) diff --git a/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj index ca2e868..87bb293 100644 --- a/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj +++ b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj @@ -115,6 +115,7 @@ Snippets\snippets.pkgdef + true VsCommandTable.vsct @@ -136,12 +137,12 @@ Snippets\Cake\cake-task.snippet true - - Snippets\CSharp\method-alias.snippet + + Snippets\Cake-Addin\method-alias.snippet true - - Snippets\CSharp\property-alias.snippet + + Snippets\Cake-Addin\property-alias.snippet true diff --git a/src/Cake.VisualStudio.2022/source.extension.vsixmanifest b/src/Cake.VisualStudio.2022/source.extension.vsixmanifest index 74a2f47..e5abd10 100644 --- a/src/Cake.VisualStudio.2022/source.extension.vsixmanifest +++ b/src/Cake.VisualStudio.2022/source.extension.vsixmanifest @@ -1,7 +1,7 @@ - + Cake for Visual Studio 2022 Adds support for the Cake build tool in Visual Studio 2022. Includes support for the Task Runner Explorer, new templates and bootstrapping important Cake files. https://github.com/cake-build/cake-vs @@ -34,7 +34,7 @@ - + diff --git a/src/Cake.VisualStudio.2022/source.extension1.cs b/src/Cake.VisualStudio.2022/source.extension1.cs index 8ce9e65..8b3fd0f 100644 --- a/src/Cake.VisualStudio.2022/source.extension1.cs +++ b/src/Cake.VisualStudio.2022/source.extension1.cs @@ -11,8 +11,8 @@ internal sealed partial class Vsix public const string Name = "Cake for Visual Studio 2022"; public const string Description = @"Adds support for the Cake build tool in Visual Studio 2022. Includes support for the Task Runner Explorer, new templates and bootstrapping important Cake files."; public const string Language = "en-US"; - public const string Version = "1.0"; - public const string Author = "Gary Ewan Park"; + public const string Version = "0.1.1.0"; + public const string Author = "Cake Build"; public const string Tags = "cake, build"; } } diff --git a/src/Cake.VisualStudio/Cake.VisualStudio.csproj b/src/Cake.VisualStudio/Cake.VisualStudio.csproj index b5204ca..fac5efd 100644 --- a/src/Cake.VisualStudio/Cake.VisualStudio.csproj +++ b/src/Cake.VisualStudio/Cake.VisualStudio.csproj @@ -138,12 +138,12 @@ Snippets\Cake\cake-task.snippet true - - Snippets\CSharp\method-alias.snippet + + Snippets\Cake-Addin\method-alias.snippet true - - Snippets\CSharp\property-alias.snippet + + Snippets\Cake-Addin\property-alias.snippet true @@ -290,6 +290,11 @@ 15.8.36 + + 15.9.3039 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + 1.1.6.1 diff --git a/src/Cake.VisualStudio/source.extension.cs b/src/Cake.VisualStudio/source.extension.cs index cfff684..d75b71e 100644 --- a/src/Cake.VisualStudio/source.extension.cs +++ b/src/Cake.VisualStudio/source.extension.cs @@ -1,11 +1,11 @@ // ------------------------------------------------------------------------------ // -// This file was generated by Extensibility Tools v1.10.188 +// This file was generated by VSIX Synchronizer // // ------------------------------------------------------------------------------ namespace Cake.VisualStudio { - static class Vsix + internal sealed partial class Vsix { public const string Id = "3cf9b016-d63f-44ee-849d-6f3efc996134"; public const string Name = "Cake for Visual Studio"; diff --git a/src/metadata/Snippets/CSharp/method-alias.snippet b/src/metadata/Snippets/Cake-Addin/method-alias.snippet similarity index 100% rename from src/metadata/Snippets/CSharp/method-alias.snippet rename to src/metadata/Snippets/Cake-Addin/method-alias.snippet diff --git a/src/metadata/Snippets/CSharp/property-alias.snippet b/src/metadata/Snippets/Cake-Addin/property-alias.snippet similarity index 100% rename from src/metadata/Snippets/CSharp/property-alias.snippet rename to src/metadata/Snippets/Cake-Addin/property-alias.snippet diff --git a/src/metadata/Snippets/snippets.pkgdef b/src/metadata/Snippets/snippets.pkgdef index 304a7c2..39f2093 100644 --- a/src/metadata/Snippets/snippets.pkgdef +++ b/src/metadata/Snippets/snippets.pkgdef @@ -1,3 +1,3 @@  -[$RootKey$\Languages\CodeExpansions\Cake\Paths] -"Snippets"="$PackageFolder$\CSharp" \ No newline at end of file +[$RootKey$\Languages\CodeExpansions\CSharp\Paths] +"Snippets"="$PackageFolder$\Cake-Addin" \ No newline at end of file From 3d9878a29e7354bcd34aa7b2028564f2ae0d90e9 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Wed, 18 Aug 2021 23:54:50 +0200 Subject: [PATCH 05/11] (#133) re-enabled Cake snippets --- .../Cake.VisualStudio.Shared.projitems | 2 + src/Cake.VisualStudio.Shared/CakePackage.cs | 13 +- .../ContentType/CakeLanguageService.cs | 2 +- .../Editor/CakeScriptSnippetsHandler.cs | 248 ++++++++++++++++++ .../Editor/CakeScriptSnippetsProvider.cs | 44 ++++ .../Helpers/Constants.cs | 5 + .../Cake.VisualStudio.csproj | 2 +- 7 files changed, 313 insertions(+), 3 deletions(-) create mode 100644 src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsHandler.cs create mode 100644 src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsProvider.cs diff --git a/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems index 35a36c1..2ebe513 100644 --- a/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems +++ b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems @@ -29,6 +29,8 @@ + + diff --git a/src/Cake.VisualStudio.Shared/CakePackage.cs b/src/Cake.VisualStudio.Shared/CakePackage.cs index d3074fb..1ebd07e 100644 --- a/src/Cake.VisualStudio.Shared/CakePackage.cs +++ b/src/Cake.VisualStudio.Shared/CakePackage.cs @@ -21,8 +21,19 @@ namespace Cake.VisualStudio [ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)] [Guid(PackageGuids.guidCakePackageString)] [ProvideMenuResource("Menus.ctmenu", 1)] - [ProvideLanguageService(typeof(CakeLanguageService), Helpers.Constants.CakeContentType, 100)] + [ProvideLanguageService(typeof(CakeLanguageService), Helpers.Constants.CakeContentType, Helpers.Constants.LanguageResourceId)] [ProvideLanguageExtension(typeof(CakeLanguageService), ".cake")] + [ProvideLanguageCodeExpansion( + typeof(CakeLanguageService), + Helpers.Constants.CakeContentType, + Helpers.Constants.LanguageResourceId, + "Cake", //the language ID used in the .snippet files + null, // omit the xml definition, use only searchPaths. + ShowRoots = false, // show the root of the searchPaths in Snippets explorer + SearchPaths = + @"$PackageFolder$\Snippets\Cake;" + + @"\%MyDocs%\Code Snippets\Cake\My Code Snippets", + ForceCreateDirs = @"\%MyDocs%\Code Snippets\Cake\My Code Snippets")] public sealed partial class CakePackage : AsyncPackage, IVsShellPropertyEvents { private static DTE2 _dte; diff --git a/src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs b/src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs index 3c6df74..42fc3fa 100644 --- a/src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs +++ b/src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs @@ -9,7 +9,7 @@ namespace Cake.VisualStudio.ContentType { - [Guid("60914246-A28E-488D-AEB7-34CCDD35FC56")] + [Guid(Constants.LanguageGuidStr)] class CakeLanguageService : LanguageService { private LanguagePreferences preferences = null; diff --git a/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsHandler.cs b/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsHandler.cs new file mode 100644 index 0000000..3345ab0 --- /dev/null +++ b/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsHandler.cs @@ -0,0 +1,248 @@ +using Microsoft.VisualStudio; +using Microsoft.VisualStudio.OLE.Interop; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Text.Editor; +using Microsoft.VisualStudio.Text.Operations; +using Microsoft.VisualStudio.TextManager.Interop; + +using MSXML; + +using System; + +namespace Cake.VisualStudio.Shared.Editor +{ + internal class CakeScriptSnippetsHandler : IOleCommandTarget, IVsExpansionClient + { + private readonly ITextView textView; + private readonly IVsTextView vsTextView; + private readonly CakeScriptSnippetsProvider provider; + private readonly IOleCommandTarget nextCommandHandler; + private readonly IVsExpansionManager expansionManager; + private IVsExpansionSession session; + + internal CakeScriptSnippetsHandler(IVsTextView textViewAdapter, ITextView textView, CakeScriptSnippetsProvider provider) + { + this.textView = textView; + this.provider = provider; + vsTextView = textViewAdapter; + + //get the text manager from the service provider + var textManager = (IVsTextManager2)provider.ServiceProvider.GetService(typeof(SVsTextManager)) ?? throw new ArgumentOutOfRangeException(nameof(provider), "Could not create a SVsTextManager!"); + textManager.GetExpansionManager(out expansionManager); + session = null; + + + //add the command to the command chain + textViewAdapter.AddCommandFilter(this, out nextCommandHandler); + } + + public int QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText) + { + ThreadHelper.ThrowIfNotOnUIThread(); + if (!VsShellUtilities.IsInAutomationFunction(provider.ServiceProvider)) + { + if (pguidCmdGroup == VSConstants.VSStd2K && cCmds > 0) + { + // make the Insert Snippet command appear on the context menu + if (prgCmds[0].cmdID == (uint)VSConstants.VSStd2KCmdID.INSERTSNIPPET) + { + prgCmds[0].cmdf = (int)Constants.MSOCMDF_ENABLED | (int)Constants.MSOCMDF_SUPPORTED; + return VSConstants.S_OK; + } + } + } + + return nextCommandHandler.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText); + } + + public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) + { + ThreadHelper.ThrowIfNotOnUIThread(); + /* + if (VsShellUtilities.IsInAutomationFunction(provider.ServiceProvider)) + { + return nextCommandHandler.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); + } + */ + + // Show the snippet picker + if (nCmdID == (uint)VSConstants.VSStd2KCmdID.INSERTSNIPPET) + { + expansionManager.InvokeInsertionUI( + vsTextView, + this, //the expansion client + Helpers.Constants.LanguageGuid, + null, //use all snippet types + 0, //number of types (0 for all) + 0, //ignored if iCountTypes == 0 + null, //use all snippet kinds + 0, //use all snippet kinds + 0, //ignored if iCountTypes == 0 + "Cake Snippets", //the text to show in the prompt + string.Empty); //only the ENTER key causes insert + + return VSConstants.S_OK; + } + + //the expansion insertion is handled in OnItemChosen + //if the expansion session is still active, handle tab/back-tab/return/cancel + if (session != null) + { + if (nCmdID == (uint)VSConstants.VSStd2KCmdID.BACKTAB) + { + session.GoToPreviousExpansionField(); + return VSConstants.S_OK; + } + else if (nCmdID == (uint)VSConstants.VSStd2KCmdID.TAB) + { + + session.GoToNextExpansionField(0); //false to support cycling through all the fields + return VSConstants.S_OK; + } + else if (nCmdID == (uint)VSConstants.VSStd2KCmdID.RETURN || nCmdID == (uint)VSConstants.VSStd2KCmdID.CANCEL) + { + if (session.EndCurrentExpansion(0) == VSConstants.S_OK) + { + session = null; + return VSConstants.S_OK; + } + } + } + + //neither an expansion session nor a completion session is open, but we got a tab, so check whether the last word typed is a snippet shortcut + if (session == null && nCmdID == (uint)VSConstants.VSStd2KCmdID.TAB) + { + //get the word that was just added + CaretPosition pos = textView.Caret.Position; + TextExtent word = provider.NavigatorService.GetTextStructureNavigator(textView.TextBuffer).GetExtentOfWord(pos.BufferPosition - 1); //use the position 1 space back + string textString = word.Span.GetText(); //the word that was just added + //if it is a code snippet, insert it, otherwise carry on + if (InsertAnyExpansion(textString, null, null)) + { + EndSession(); + return VSConstants.S_OK; + } + } + + return nextCommandHandler.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); + } + + public int EndExpansion() + { + session = null; + return VSConstants.S_OK; + } + + public int FormatSpan(IVsTextLines pBuffer, TextSpan[] ts) + { + return VSConstants.S_OK; + } + + public int GetExpansionFunction(IXMLDOMNode xmlFunctionNode, string bstrFieldName, out IVsExpansionFunction pFunc) + { + pFunc = null; + return VSConstants.S_OK; + } + + public int IsValidKind(IVsTextLines pBuffer, TextSpan[] ts, string bstrKind, out int pfIsValidKind) + { + pfIsValidKind = 1; + return VSConstants.S_OK; + } + + public int IsValidType(IVsTextLines pBuffer, TextSpan[] ts, string[] rgTypes, int iCountTypes, out int pfIsValidType) + { + pfIsValidType = 1; + return VSConstants.S_OK; + } + + public int OnAfterInsertion(IVsExpansionSession pSession) + { + return VSConstants.S_OK; + } + + public int OnBeforeInsertion(IVsExpansionSession pSession) + { + return VSConstants.S_OK; + } + + public int PositionCaretForEditing(IVsTextLines pBuffer, TextSpan[] ts) + { + return VSConstants.S_OK; + } + + public int OnItemChosen(string pszTitle, string pszPath) + { + if (InsertAnyExpansion(null, pszTitle, pszPath)) + { + EndSession(); + } + + return VSConstants.S_OK; + } + + private void EndSession() + { + if (session != null) + { + session.EndCurrentExpansion(0); + session = null; + } + } + + private bool InsertAnyExpansion(string shortcut, string title, string path) + { + //first get the location of the caret, and set up a TextSpan + //get the column number from the IVsTextView, not the ITextView + vsTextView.GetCaretPos(out int startLine, out int endColumn); + + var addSpan = new TextSpan + { + iStartIndex = endColumn, + iEndIndex = endColumn, + iStartLine = startLine, + iEndLine = startLine + }; + + if (shortcut != null) //get the expansion from the shortcut + { + //reset the TextSpan to the width of the shortcut, + //because we're going to replace the shortcut with the expansion + addSpan.iStartIndex = addSpan.iEndIndex - shortcut.Length; + + expansionManager.GetExpansionByShortcut( + this, + Helpers.Constants.LanguageGuid, + shortcut, + vsTextView, + new TextSpan[] { addSpan }, + 0, + out path, + out title); + + } + if (title != null && path != null) + { + vsTextView.GetBuffer(out IVsTextLines textLines); + var bufferExpansion = (IVsExpansion)textLines; + + if (bufferExpansion != null) + { + int hr = bufferExpansion.InsertNamedExpansion( + title, + path, + addSpan, + this, + Helpers.Constants.LanguageGuid, + 0, + out session); + if (VSConstants.S_OK == hr) + { + return true; + } + } + } + return false; + } + } +} \ No newline at end of file diff --git a/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsProvider.cs b/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsProvider.cs new file mode 100644 index 0000000..24a6c0c --- /dev/null +++ b/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsProvider.cs @@ -0,0 +1,44 @@ +using Microsoft.VisualStudio.Editor; +using Microsoft.VisualStudio.Language.Intellisense; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Text.Editor; +using Microsoft.VisualStudio.Text.Operations; +using Microsoft.VisualStudio.TextManager.Interop; +using Microsoft.VisualStudio.Utilities; + +using System; +using System.ComponentModel.Composition; + +namespace Cake.VisualStudio.Shared.Editor +{ + [Export(typeof(IVsTextViewCreationListener))] + [Name("Cake snippets handler")] + [ContentType(Helpers.Constants.CakeContentType)] + [TextViewRole(PredefinedTextViewRoles.Editable)] + internal class CakeScriptSnippetsProvider : IVsTextViewCreationListener + { + [Import] + internal IVsEditorAdaptersFactoryService AdapterService = null; + + [Import] + internal ICompletionBroker CompletionBroker { get; set; } + + [Import] + internal SVsServiceProvider ServiceProvider { get; set; } + + [Import] + internal ITextStructureNavigatorSelectorService NavigatorService { get; set; } + + public void VsTextViewCreated(IVsTextView textViewAdapter) + { + ITextView textView = AdapterService.GetWpfTextView(textViewAdapter); + if (textView == null) + { + return; + } + + Func generator = () => new CakeScriptSnippetsHandler(textViewAdapter, textView, this); + textView.Properties.GetOrCreateSingletonProperty(generator); + } + } +} diff --git a/src/Cake.VisualStudio.Shared/Helpers/Constants.cs b/src/Cake.VisualStudio.Shared/Helpers/Constants.cs index bb6db65..eab5525 100644 --- a/src/Cake.VisualStudio.Shared/Helpers/Constants.cs +++ b/src/Cake.VisualStudio.Shared/Helpers/Constants.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; + namespace Cake.VisualStudio.Helpers { public static class Constants @@ -22,5 +24,8 @@ public static class Constants public const string ConfigTemplatePath = "https://cakebuild.net/download/configuration"; public const string ConfigFileName = "cake.config"; public const string ScriptFileName = "build.cake"; + public const int LanguageResourceId = 100; + public const string LanguageGuidStr = "60914246-A28E-488D-AEB7-34CCDD35FC56"; + public static Guid LanguageGuid = Guid.Parse(LanguageGuidStr); } } \ No newline at end of file diff --git a/src/Cake.VisualStudio/Cake.VisualStudio.csproj b/src/Cake.VisualStudio/Cake.VisualStudio.csproj index fac5efd..3b36507 100644 --- a/src/Cake.VisualStudio/Cake.VisualStudio.csproj +++ b/src/Cake.VisualStudio/Cake.VisualStudio.csproj @@ -122,7 +122,6 @@ VsCommandTable.vsct Menus.ctmenu VsctGenerator - ..\metadata\VsCommandTable.cs source.extension.vsixmanifest @@ -210,6 +209,7 @@ + From 5cf02df73f66f55f56d1708d99e5e8a611c6a79f Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Thu, 19 Aug 2021 08:24:09 +0200 Subject: [PATCH 06/11] (#133) re-enabled file-icon --- .../Cake.VisualStudio.2022.csproj | 11 ++++++----- src/Cake.VisualStudio/Cake.VisualStudio.csproj | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj index 87bb293..7f9731d 100644 --- a/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj +++ b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj @@ -88,15 +88,15 @@ icons.pkgdef + true Resources\cake-icon.ico true - + Resources\CakeFile.png - true - + Resources\icon.png true @@ -126,9 +126,10 @@ source.extension.vsixmanifest - + FileIcons.imagemanifest - + true + Snippets\Cake\argument.snippet true diff --git a/src/Cake.VisualStudio/Cake.VisualStudio.csproj b/src/Cake.VisualStudio/Cake.VisualStudio.csproj index 3b36507..f1f8aae 100644 --- a/src/Cake.VisualStudio/Cake.VisualStudio.csproj +++ b/src/Cake.VisualStudio/Cake.VisualStudio.csproj @@ -94,10 +94,9 @@ Resources\cake-icon.ico true - + Resources\CakeFile.png - true - + Resources\icon.png true @@ -126,9 +125,10 @@ source.extension.vsixmanifest - + FileIcons.imagemanifest - + true + Snippets\Cake\argument.snippet true From aa45a305575d14197af5b98e767d8a77700dcb63 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Thu, 19 Aug 2021 17:42:56 +0200 Subject: [PATCH 07/11] (maint) cleanup Since the resx was removed, the references to resource-keys were also removed. Microsoft.VSSDK.BuildTools set to the same version in both projects, as correlation with the sdk is not needed. (Setting both to the same version is the equivalent of building both projects using the same Visual Studio.) --- src/Cake.VisualStudio.Shared/CakePackage.cs | 2 +- src/Cake.VisualStudio/Cake.VisualStudio.csproj | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Cake.VisualStudio.Shared/CakePackage.cs b/src/Cake.VisualStudio.Shared/CakePackage.cs index 1ebd07e..84ee875 100644 --- a/src/Cake.VisualStudio.Shared/CakePackage.cs +++ b/src/Cake.VisualStudio.Shared/CakePackage.cs @@ -17,7 +17,7 @@ namespace Cake.VisualStudio { [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] - [InstalledProductRegistration("#110", "#112", Vsix.Version, IconResourceID = 400)] + [InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)] [ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)] [Guid(PackageGuids.guidCakePackageString)] [ProvideMenuResource("Menus.ctmenu", 1)] diff --git a/src/Cake.VisualStudio/Cake.VisualStudio.csproj b/src/Cake.VisualStudio/Cake.VisualStudio.csproj index f1f8aae..fc0276e 100644 --- a/src/Cake.VisualStudio/Cake.VisualStudio.csproj +++ b/src/Cake.VisualStudio/Cake.VisualStudio.csproj @@ -121,6 +121,7 @@ VsCommandTable.vsct Menus.ctmenu VsctGenerator + VsCommandTable.cs source.extension.vsixmanifest @@ -291,7 +292,7 @@ 15.8.36 - 15.9.3039 + 17.0.2155-preview2 runtime; build; native; contentfiles; analyzers; buildtransitive all From 92b7da5f1c429a5389febfef51227f0473884c27 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Thu, 19 Aug 2021 17:52:45 +0200 Subject: [PATCH 08/11] (#133) fixed build --- build.cake | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build.cake b/build.cake index 4134ce9..c748de9 100644 --- a/build.cake +++ b/build.cake @@ -171,7 +171,8 @@ Task("Post-Build") .IsDependentOn("Build") .Does(() => { - CopyFileToDirectory("./src/bin/" + configuration + "/Cake.VisualStudio.vsix", artifacts); + CopyFile("./src/Cake.VisualStudio/bin/" + configuration + "/Cake.VisualStudio.vsix", artifacts + "/Cake.VisualStudio.2019.vsix"); + CopyFile("./src/Cake.VisualStudio.2022/bin/" + configuration + "/Cake.VisualStudio.vsix", artifacts + "/Cake.VisualStudio.2022.vsix"); }); Task("Publish-GitHub-Release") @@ -179,9 +180,11 @@ Task("Publish-GitHub-Release") .Does(() => { var buildResultDir = Directory(artifacts); - var packageFile = File("Cake.VisualStudio.vsix"); + var packageFile2019 = File("Cake.VisualStudio.2019.vsix"); + var packageFile2022 = File("Cake.VisualStudio.2022.vsix"); - GitReleaseManagerAddAssets(parameters.GitHub.Token, "cake-build", "cake-vs", parameters.Version.Milestone, buildResultDir + packageFile); + GitReleaseManagerAddAssets(parameters.GitHub.Token, "cake-build", "cake-vs", parameters.Version.Milestone, buildResultDir + packageFile2019); + GitReleaseManagerAddAssets(parameters.GitHub.Token, "cake-build", "cake-vs", parameters.Version.Milestone, buildResultDir + packageFile2022); GitReleaseManagerClose(parameters.GitHub.Token, "cake-build", "cake-vs", parameters.Version.Milestone); }) .OnError(exception => @@ -195,7 +198,8 @@ Task("Upload-Artifact") .WithCriteria(() => parameters.ShouldPublishToAppVeyor) .Does(() => { - AppVeyor.UploadArtifact(artifacts + "Cake.VisualStudio.vsix"); + AppVeyor.UploadArtifact(artifacts + "Cake.VisualStudio.2019.vsix"); + AppVeyor.UploadArtifact(artifacts + "Cake.VisualStudio.2022.vsix"); }); Task("Publish-Extension") @@ -203,11 +207,12 @@ Task("Publish-Extension") .WithCriteria(() => parameters.ShouldPublishToMyGet) .Does(() => { - var vsixPath = artifacts + "Cake.VisualStudio.vsix"; var client = MyGetClient.GetClient(parameters.MyGet.Url, parameters.MyGet.Key, s => Context.Verbose(s)); - Information("Uploading VSIX to {0}...", parameters.MyGet.Url); - var response = client.UploadVsix(GetFile(artifacts + "Cake.VisualStudio.vsix")); - Information("VSIX Upload {0}", response.IsSuccessStatusCode ? "succeeded." : "failed with reason '" + response.ReasonPhrase + "'."); + Information("Uploading VSIXs to {0}...", parameters.MyGet.Url); + var response = client.UploadVsix(GetFile(artifacts + "Cake.VisualStudio.2019.vsix")); + Information("VSIX Upload (2019) {0}", response.IsSuccessStatusCode ? "succeeded." : "failed with reason '" + response.ReasonPhrase + "'."); + response = client.UploadVsix(GetFile(artifacts + "Cake.VisualStudio.2022.vsix")); + Information("VSIX Upload (2019) {0}", response.IsSuccessStatusCode ? "succeeded." : "failed with reason '" + response.ReasonPhrase + "'."); }); Task("Default") From 4f94a221c033f1f6d0188efc402c71a325604c3c Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Mon, 23 Aug 2021 20:42:03 +0100 Subject: [PATCH 09/11] (doc) Update description for supported VS Versions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fefc503..a5cd664 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Cake for Visual Studio Adds support for the [Cake](https://cakebuild.net/) -build tool in Visual Studio 2017 and 2019. Includes support for the Task Runner Explorer, +build tool in Visual Studio 2017, 2019, and 2022. Includes support for the Task Runner Explorer, new item and project templates and bootstrapping important Cake files Originally based off Mads Kristensen's [Brunch Task Runner](https://github.com/madskristensen/BrunchTaskRunner) extension. From 8cfe0340e5c5b34243ee475b813a85683947f3d2 Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Mon, 23 Aug 2021 20:55:28 +0100 Subject: [PATCH 10/11] (#128) Make URL's absolute This way they will work both in the marketplace, and in the GitHub Readme without additional work. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a5cd664..10dfc98 100644 --- a/README.md +++ b/README.md @@ -28,22 +28,22 @@ a `build.cake` file. Open Task Runner Explorer by right-clicking the Cake script and select **Task Runner Explorer** from the context menu: -![Open Task Runner Explorer](art/open-trx.png) +![Open Task Runner Explorer](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/open-trx.png) Individual tasks will be listed in the task list on the left. -![Task List](art/task-list.png) +![Task List](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/task-list.png) Each task can be executed by double-clicking the task. -![Console output](art/console.png) +![Console output](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/console.png) ### Bindings Task bindings make it possible to associate individual tasks with Visual Studio events such as _Project Open_ etc. -![Bindings](art/bindings.png) +![Bindings](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/bindings.png) These bindings are stored in your `cake.config` file. @@ -57,13 +57,13 @@ However, at this time, it will not automatically download Cake for you. Choose Cake Build from the Build menu to quickly install the default bootstrapper scripts or Cake configuration files into your solution. -![Template installers](art/installers.png) +![Template installers](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/installers.png) ## Templates The extension includes an item template for build scripts and project templates for Cake modules, addins, and unit tests. -![Project Template](art/templates.png) +![Project Template](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/templates.png) ## Contribute From 51805b689875d294f4b7872a57a3109db5ca41df Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Mon, 23 Aug 2021 21:04:00 +0100 Subject: [PATCH 11/11] (build) Update path to manifest(s) So that updating the version numbers is working on correct file path. --- build.cake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.cake b/build.cake index c748de9..7362c56 100644 --- a/build.cake +++ b/build.cake @@ -108,7 +108,12 @@ Task("Update-Manifest-Version") { BuildVersion.UpdateManifestVersion( context: Context, - path: "./src/source.extension.vsixmanifest" + path: "./src/Cake.VisualStudio/source.extension.vsixmanifest" + ); + + BuildVersion.UpdateManifestVersion( + context: Context, + path: "./src/Cake.VisualStudio.2022/source.extension.vsixmanifest" ); });