diff --git a/.github/workflows/release_build_and_deploy.yml b/.github/workflows/release_build_and_deploy.yml
index c3c845d..c8e8577 100644
--- a/.github/workflows/release_build_and_deploy.yml
+++ b/.github/workflows/release_build_and_deploy.yml
@@ -1,29 +1,31 @@
name: 'Build and Deploy'
-
+
on:
workflow_dispatch:
pull_request:
types: [opened, reopened]
push:
- branches:
+ branches:
- main
-
+
jobs:
- Release-Build-and-Deploy:
+ Release-Build-and-Deploy:
runs-on: windows-latest
-
+
steps:
- uses: actions/checkout@v4
- - uses: microsoft/setup-msbuild@v2
- - uses: nuget/setup-nuget@v2
- - name: 1. Versioning Release
- id: step-version
- uses: CodingWithCalvin/GHA-VSVsixVersioner@v1
- with:
- extension-manifest-file: 'src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.vsixmanifest'
- extension-source-file: 'src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.cs'
-
+ - name: 1. Generate Version
+ id: version
+ run: |
+ $year = (Get-Date).Year
+ $month = (Get-Date).Month
+ $day = (Get-Date).Day
+ $version = "$year.$month.$day.${{ github.run_number }}"
+ echo "version=$version" >> $env:GITHUB_OUTPUT
+ Write-Host "Generated version: $version"
+ shell: pwsh
+
- name: 2. Inject Honeycomb API Key
run: |
$file = 'src/CodingWithCalvin.OpenInNotepadPlusPlus/HoneycombConfig.cs'
@@ -32,21 +34,18 @@ jobs:
Set-Content $file $content
shell: pwsh
- - name: 3. Restoring Packages
- run: nuget restore ./src/CodingWithCalvin.OpenInNotepadPlusPlus.slnx
-
- - name: 4. Building Project
- run: msbuild 'src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj' /p:configuration='Release' /p:platform=AnyCPU /p:DeployExtension=False
+ - name: 3. Building Project
+ run: dotnet build src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj -c Release -p:Version=${{ steps.version.outputs.version }}
- - name: 5. Create Information File
+ - name: 4. Create Information File
uses: jsdaniell/create-json@v1.2.3
with:
- name: 'src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/CodingWithCalvin.OpenInNotepadPlusPlus.info'
- json: '{"sha":"${{ github.sha }}", "version":"${{ steps.step-version.outputs.version }}"}'
+ name: 'src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/net48/CodingWithCalvin.OpenInNotepadPlusPlus.info'
+ json: '{"sha":"${{ github.sha }}", "version":"${{ steps.version.outputs.version }}"}'
- - name: 6. Publishing Build Artifact
+ - name: 5. Publishing Build Artifact
uses: actions/upload-artifact@v4
with:
path: |
- src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/CodingWithCalvin.OpenInNotepadPlusPlus.info
- src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/CodingWithCalvin.OpenInNotepadPlusPlus.vsix
+ src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/net48/CodingWithCalvin.OpenInNotepadPlusPlus.info
+ src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release/net48/CodingWithCalvin.OpenInNotepadPlusPlus.vsix
diff --git a/.gitignore b/.gitignore
index 7c2bd1a..f3696fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -156,3 +156,5 @@ $RECYCLE.BIN/
# Claude Code local settings
.claude/
CLAUDE.local.md
+
+src/**/*.g.cs
diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj b/src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj
index b35064f..577b036 100644
--- a/src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj
+++ b/src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj
@@ -1,120 +1,30 @@
-
-
+
+
- 17.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
- true
-
-
- bin\Release\
-
-
- true
- AnyCPU
- latest
- False
-
-
- true
- bin\Debug\
- TRACE;DEBUG
- full
- AnyCPU
- latest
- True
- False
-
-
-
- Debug
- AnyCPU
- 2.0
- {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- {ADD4175C-AA5C-49E4-AFAF-6B9D3E832E8D}
- Library
- Properties
+ net48
CodingWithCalvin.OpenInNotepadPlusPlus
CodingWithCalvin.OpenInNotepadPlusPlus
- v4.8
- true
- true
- true
- true
- true
- false
latest
- Program
- $(DevEnvDir)devenv.exe
- /rootsuffix Exp
- v3
+
+
+ True
+
+
-
- 17.14.40265
-
-
- 17.14.2120
- runtime; build; native; contentfiles; analyzers
-
-
- 0.2.0
-
-
-
-
-
-
-
-
-
-
- Designer
- VsixManifestGenerator
- source.extension.cs
-
+
+
+
-
- resources\icon.png
+
true
-
- resources\LICENSE
+
true
-
- resources\logo.png
+
true
-
-
- Menus.ctmenu
- VsctGenerator
- VSCommandTable.cs
-
-
-
-
-
-
- Component
-
-
-
-
-
-
- True
- True
- source.extension.vsixmanifest
-
-
- True
- True
- VSCommandTable.vsct
-
-
-
-
-
\ No newline at end of file
+
diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/Commands/OpenExecutableCommand.cs b/src/CodingWithCalvin.OpenInNotepadPlusPlus/Commands/OpenExecutableCommand.cs
index 0121db5..89bab1d 100644
--- a/src/CodingWithCalvin.OpenInNotepadPlusPlus/Commands/OpenExecutableCommand.cs
+++ b/src/CodingWithCalvin.OpenInNotepadPlusPlus/Commands/OpenExecutableCommand.cs
@@ -1,14 +1,15 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.Design;
-using System.Diagnostics;
-using System.Windows.Forms;
-using CodingWithCalvin.OpenInNotepadPlusPlus.Dialogs;
+using CodingWithCalvin.OpenInNotepadPlusPlus.Dialogs;
using CodingWithCalvin.OpenInNotepadPlusPlus.Helpers;
using CodingWithCalvin.Otel4Vsix;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.Design;
+using System.Diagnostics;
+using System.Windows.Forms;
+using static CodingWithCalvin.OpenInNotepadPlusPlus.VSCommandTableVsct;
namespace CodingWithCalvin.OpenInNotepadPlusPlus.Commands
{
@@ -28,8 +29,8 @@ private OpenExecutableCommand(Package package, SettingsDialogPage settings)
if (commandService != null)
{
var menuCommandId = new CommandID(
- PackageGuids.guidOpenInNppCmdSet,
- PackageIds.OpenInNpp
+ guidOpenInNppCmdSet.Guid,
+ guidOpenInNppCmdSet.OpenInNpp
);
var menuItem = new MenuCommand(OpenPath, menuCommandId);
commandService.AddCommand(menuItem);
@@ -47,12 +48,13 @@ public static void Initialize(Package package, SettingsDialogPage settings)
private void OpenPath(object sender, EventArgs e)
{
+ ThreadHelper.ThrowIfNotOnUIThread();
+
using var activity = VsixTelemetry.StartCommandActivity("OpenInNotepadPlusPlus.OpenPath");
var service = (DTE2)this.ServiceProvider.GetService(typeof(DTE));
try
{
- ThreadHelper.ThrowIfNotOnUIThread();
var selectedFilePath = ProjectHelpers.GetSelectedPath(service);
var executablePath = _settings.FolderPath;
@@ -91,10 +93,7 @@ private static void OpenExecutable(string executablePath, string selectedFilePat
WindowStyle = ProcessWindowStyle.Hidden
};
- using (System.Diagnostics.Process.Start(startInfo))
- {
- //TODO : Should this be empty?
- }
+ using (System.Diagnostics.Process.Start(startInfo)) {}
}
}
}
diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/OpenInNotepadPlusPlusPackage.cs b/src/CodingWithCalvin.OpenInNotepadPlusPlus/OpenInNotepadPlusPlusPackage.cs
index 8d59219..6be7c5d 100644
--- a/src/CodingWithCalvin.OpenInNotepadPlusPlus/OpenInNotepadPlusPlusPackage.cs
+++ b/src/CodingWithCalvin.OpenInNotepadPlusPlus/OpenInNotepadPlusPlusPackage.cs
@@ -9,10 +9,10 @@
namespace CodingWithCalvin.OpenInNotepadPlusPlus
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
- [InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)]
+ [InstalledProductRegistration(VsixInfo.DisplayName, VsixInfo.Description, VsixInfo.Version)]
[ProvideOptionPage(
typeof(SettingsDialogPage),
- Vsix.Name,
+ VsixInfo.DisplayName,
"General",
101,
111,
@@ -21,7 +21,7 @@ namespace CodingWithCalvin.OpenInNotepadPlusPlus
ProvidesLocalizedCategoryName = false
)]
[ProvideMenuResource("Menus.ctmenu", 1)]
- [Guid(PackageGuids.guidPackageString)]
+ [Guid("6AEABF47-7BDC-47B3-ADE7-06F5BAE6D868")]
public sealed class OpenInNotepadPlusPlusPackage : AsyncPackage
{
protected override async System.Threading.Tasks.Task InitializeAsync(
@@ -34,8 +34,8 @@ IProgress progress
var settings = (SettingsDialogPage)this.GetDialogPage(typeof(SettingsDialogPage));
var builder = VsixTelemetry.Configure()
- .WithServiceName(Vsix.Name)
- .WithServiceVersion(Vsix.Version)
+ .WithServiceName(VsixInfo.DisplayName)
+ .WithServiceVersion(VsixInfo.Version)
.WithVisualStudioAttributes(this)
.WithEnvironmentAttributes();
diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/Properties/AssemblyInfo.cs b/src/CodingWithCalvin.OpenInNotepadPlusPlus/Properties/AssemblyInfo.cs
deleted file mode 100644
index 44a7490..0000000
--- a/src/CodingWithCalvin.OpenInNotepadPlusPlus/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-using CodingWithCalvin.OpenInNotepadPlusPlus;
-
-[assembly: AssemblyTitle(Vsix.Name)]
-[assembly: AssemblyDescription(Vsix.Description)]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany(Vsix.Author)]
-[assembly: AssemblyProduct(Vsix.Name)]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-[assembly: AssemblyVersion(Vsix.Version)]
-[assembly: AssemblyFileVersion(Vsix.Version)]
diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/Properties/launchSettings.json b/src/CodingWithCalvin.OpenInNotepadPlusPlus/Properties/launchSettings.json
new file mode 100644
index 0000000..8c26749
--- /dev/null
+++ b/src/CodingWithCalvin.OpenInNotepadPlusPlus/Properties/launchSettings.json
@@ -0,0 +1,9 @@
+{
+ "profiles": {
+ "Start Experimental Instance": {
+ "commandName": "Executable",
+ "executablePath": "C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\Common7\\IDE\\devenv.exe",
+ "commandLineArgs": "/rootSuffix Exp"
+ }
+ }
+}
diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/VSCommandTable.cs b/src/CodingWithCalvin.OpenInNotepadPlusPlus/VSCommandTable.cs
deleted file mode 100644
index 3e0bb0c..0000000
--- a/src/CodingWithCalvin.OpenInNotepadPlusPlus/VSCommandTable.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// This file was generated by VSIX Synchronizer
-//
-// ------------------------------------------------------------------------------
-namespace CodingWithCalvin.OpenInNotepadPlusPlus
-{
- using System;
-
- ///
- /// Helper class that exposes all GUIDs used across VS Package.
- ///
- internal sealed partial class PackageGuids
- {
- public const string guidPackageString = "6aeabf47-7bdc-47b3-ade7-06f5bae6d868";
- public static Guid guidPackage = new Guid(guidPackageString);
-
- public const string guidOpenInNppCmdSetString = "f781199d-54a8-4a18-ac9d-a91f292587db";
- public static Guid guidOpenInNppCmdSet = new Guid(guidOpenInNppCmdSetString);
-
- public const string guidIconsString = "3a06fde0-497f-4b1f-9150-5b1c5879e8af";
- public static Guid guidIcons = new Guid(guidIconsString);
- }
- ///
- /// Helper class that encapsulates all CommandIDs uses across VS Package.
- ///
- internal sealed partial class PackageIds
- {
- public const int OpenInNpp = 0x0100;
- public const int NotepadPlusPlus = 0x0001;
- }
-}
\ No newline at end of file
diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.cs b/src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.cs
deleted file mode 100644
index ea25c7e..0000000
--- a/src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// This file was generated by VSIX Synchronizer
-//
-// ------------------------------------------------------------------------------
-namespace CodingWithCalvin.OpenInNotepadPlusPlus
-{
- internal sealed partial class Vsix
- {
- public const string Id = "VS-OpenInNotepadPlusPlus";
- public const string Name = "Open in Notepad++";
- public const string Description = @"Adds a menu command that lets you open any solution, project, folder and file in Notepad++";
- public const string Language = "en-US";
- public const string Version = "4.1.0";
- public const string Author = "Coding With Calvin";
- public const string Tags = "notepad++, text, code";
- }
-}
diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.vsixmanifest b/src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.vsixmanifest
index 3855375..ce99f79 100644
--- a/src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.vsixmanifest
+++ b/src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.vsixmanifest
@@ -1,7 +1,7 @@
-
+
Open in Notepad++
Adds a menu command that lets you open any solution, project, folder and file in Notepad++
https://github.com/CodingWithCalvin/VS-OpenInNotepadPlusPlus
@@ -10,9 +10,12 @@
notepad++, text, code
-