Skip to content

Commit

Permalink
v1.2 Fixed issue with locating paths with spaces, updated icon
Browse files Browse the repository at this point in the history
  • Loading branch information
atkulp committed Nov 1, 2017
1 parent da786b8 commit 7de9bdb
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 19 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
StringAsFilenameDebuggerVisualizer
Debugger Visualizer Pack by Arian
==================================

Arian T. Kulp
-------------

Debugger visualizers for Visual Studio 2017 to open/view files by taking a string
Debugger Visualizer Pack by Arian for Visual Studio 2017 lets you open/view files by taking a string
variable value as the filename.

Install using prebuilt VSIX or install manually by copying the built DLL
(ArianKulp.DebuggerExtensions.dll) to \$UserProfileStudio 2017.

You can also add this extension from the **Tools | Extensions and Updates** menu
in Visual Studio or from the [Visual Studio Gallery](https://marketplace.visualstudio.com/items?itemName=ArianKulp.DebuggerVisualizerPackbyArian).

Note, this actually adds multiple visualizers so you can locate the file in Windows Explorer, open the file in Visual
Studio (without adding it to the project/solution), or in Notepad.

### Release History

- v1.2

- Fixed issue with paths with spaces opening in Windows Explorer
- Added better icon

- v1.1

- Update to proper installation of visualizer via VSIX
Expand All @@ -36,4 +44,7 @@ None at the moment
- Possibly add option to save current string value into temp file and then
open it

- Add option to Peek at file contents in current window
- Add option to Peek at file contents in current window

### Attributions
File Search icon by Chanut is Industries from the Noun Project
14 changes: 7 additions & 7 deletions Solution/Package/Package.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\StringDebuggerPackage.ico</ApplicationIcon>
<ApplicationIcon>Resources\noun_586565_cc.ico</ApplicationIcon>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -62,12 +62,6 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\StringDebuggerPackage.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<ItemGroup>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
Expand Down Expand Up @@ -158,6 +152,12 @@
<Name>StringExtensions</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\noun_586565_cc.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
4 changes: 2 additions & 2 deletions Solution/Package/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// 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.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
Binary file not shown.
Binary file added Solution/Package/Resources/noun_586565_cc.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions Solution/Package/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="StringOpenFileDebugger.8386b8d5-d629-4ebc-a6f8-d41cdc1342fb" Version="1.1" Language="en-US" Publisher="Arian T. Kulp" />
<Identity Id="StringOpenFileDebugger.8386b8d5-d629-4ebc-a6f8-d41cdc1342fb" Version="1.2" Language="en-US" Publisher="Arian T. Kulp" />
<DisplayName>Debugger Visualizer Pack by Arian</DisplayName>
<Description xml:space="preserve">Various debugging visualizers including open file from filename in string variable.</Description>
<Icon>Resources\StringDebuggerPackage.ico</Icon>
<Icon>Resources\noun_586565_cc.ico</Icon>
<Tags>debugger, string, visualizer, open file</Tags>
</Metadata>
<Installation>
Expand Down
4 changes: 2 additions & 2 deletions Solution/StringExtensions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
9 changes: 6 additions & 3 deletions Solution/StringExtensions/StringOpenFileDebuggerExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,18 @@ override protected void Show(IDialogVisualizerService windowService, IVisualizer

if (fn != null && ServiceProvider.GlobalProvider.GetService(typeof(DTE)) is DTE2 dte2)
{
if (!File.Exists(fn))
if (!File.Exists(fn) && !Directory.Exists(fn))
{
ShowError("File does not exist");
ShowError("File/folder does not exist");
return;
}

var attr = File.GetAttributes(fn);
var isFolder = (attr & FileAttributes.Directory) != 0;

// combine the arguments together
// it doesn't matter if there is a space after ','
string argument = "/select, \"" + fn + "\"";
string argument = isFolder ? $"\"{fn}\"" : $"/select, \"{fn}\"";

System.Diagnostics.Process.Start("explorer.exe", argument);
}
Expand Down

0 comments on commit 7de9bdb

Please sign in to comment.