Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 24 additions & 25 deletions .github/workflows/release_build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,5 @@ $RECYCLE.BIN/
# Claude Code local settings
.claude/
CLAUDE.local.md

src/**/*.g.cs
Original file line number Diff line number Diff line change
@@ -1,120 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="CodingWithCalvin.VsixSdk/0.3.0">

<PropertyGroup>
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<UseCodebase>true</UseCodebase>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<DeployExtension>True</DeployExtension>
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{ADD4175C-AA5C-49E4-AFAF-6B9D3E832E8D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>net48</TargetFramework>
<RootNamespace>CodingWithCalvin.OpenInNotepadPlusPlus</RootNamespace>
<AssemblyName>CodingWithCalvin.OpenInNotepadPlusPlus</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<LangVersion>latest</LangVersion>
<StartAction>Program</StartAction>
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
<VsixType>v3</VsixType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DeployExtension>True</DeployExtension>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.SDK">
<Version>17.14.40265</Version>
</PackageReference>
<PackageReference Include="Microsoft.VSSDK.BuildTools">
<Version>17.14.2120</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="CodingWithCalvin.Otel4Vsix">
<Version>0.2.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Design" />
<Reference Include="System.Windows.Forms" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
<Generator>VsixManifestGenerator</Generator>
<LastGenOutput>source.extension.cs</LastGenOutput>
</None>
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.14.40265" />
<PackageReference Include="CodingWithCalvin.Otel4Vsix" Version="0.2.0" />
</ItemGroup>

<ItemGroup>
<Content Include="..\..\resources\icon.png">
<Link>resources\icon.png</Link>
<Content Include="..\..\resources\icon.png" Link="resources\icon.png">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\..\LICENSE">
<Link>resources\LICENSE</Link>
<Content Include="..\..\LICENSE" Link="resources\LICENSE">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\..\resources\logo.png">
<Link>resources\logo.png</Link>
<Content Include="..\..\resources\logo.png" Link="resources\logo.png">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<ItemGroup>
<VSCTCompile Include="VSCommandTable.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<Generator>VsctGenerator</Generator>
<LastGenOutput>VSCommandTable.cs</LastGenOutput>
</VSCTCompile>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Compile Include="Commands\OpenExecutableCommand.cs" />
<Compile Include="Dialogs\SettingsDialogPage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Helpers\ProjectHelpers.cs" />
<Compile Include="OpenInNotepadPlusPlusPackage.cs" />
<Compile Include="HoneycombConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="source.extension.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>source.extension.vsixmanifest</DependentUpon>
</Compile>
<Compile Include="VSCommandTable.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>VSCommandTable.vsct</DependentUpon>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -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);
Expand All @@ -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;

Expand Down Expand Up @@ -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)) {}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand All @@ -34,8 +34,8 @@ IProgress<ServiceProgressData> 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();

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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"
}
}
}
32 changes: 0 additions & 32 deletions src/CodingWithCalvin.OpenInNotepadPlusPlus/VSCommandTable.cs

This file was deleted.

18 changes: 0 additions & 18 deletions src/CodingWithCalvin.OpenInNotepadPlusPlus/source.extension.cs

This file was deleted.

Loading