From 0173b8a30811a8c64f26b8d1f3584f442b7baea0 Mon Sep 17 00:00:00 2001 From: Dominic Foti Date: Wed, 4 Apr 2018 09:47:44 -0400 Subject: [PATCH 1/2] Ignoring projectItem.Kind exception thrown by some project types --- OpenFileInSolutionPackage.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/OpenFileInSolutionPackage.cs b/OpenFileInSolutionPackage.cs index ffb9785..f0915a9 100644 --- a/OpenFileInSolutionPackage.cs +++ b/OpenFileInSolutionPackage.cs @@ -105,7 +105,7 @@ public OpenFileInSolutionPackage() /// protected override void Initialize() { - Debug.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); + Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; @@ -180,17 +180,24 @@ private IEnumerable EnumerateProjectItems(ProjectItems items for (int i = 1; i <= items.Count; i++) { var itm = items.Item(i); - var itmGuid = Guid.Parse(itm.Kind); - + foreach (var res in EnumerateProjectItems(itm.ProjectItems)) { yield return res; } - if (itmGuid.Equals(ProjectVirtualFolderGuid) - || itmGuid.Equals(ProjectFolderGuid)) + try + { + var itmGuid = Guid.Parse(itm.Kind); + if (itmGuid.Equals(ProjectVirtualFolderGuid) + || itmGuid.Equals(ProjectFolderGuid)) + { + continue; + } + } + catch (Exception) { - continue; + // itm.Kind may throw an exception with certain node types like WixExtension (COMException) } for (short j = 0; itm != null && j < itm.FileCount; j++) From f4276250474ef0d55646169de859bc45cdfbe8cb Mon Sep 17 00:00:00 2001 From: Dominic Foti Date: Wed, 4 Apr 2018 10:01:03 -0400 Subject: [PATCH 2/2] Added screenshot and description to readme --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3dc5d9e..ec9baa6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ -VSQuickOpenFile -=============== +# VSQuickOpenFile + +Quickly display a list of files in your solution for opening. Supports searching by filename or path. Functions just like `Shift`+`Alt`+`O` in Visual Assist. + +![Quick Open File](openfileinsolution.png?raw=true "Quick Open File") + +This extension will parse the projects in your solution and look for files. Once it has built a list of these files, it allows you to search through them for the file you want to open and open it quickly. It supports searching for pieces of the filename in any order and can easily highlight multiple files with just the keyboard to open all at once. + +## Usage +- Use the "Open File In Solution" entry at the top of the Tools menu. +- Set a key binding for Tools.OpenFileInSolution + +## Installation +[Download](https://marketplace.visualstudio.com/items?itemName=PerniciousGames.OpenFileInSolution) this extension from the Visual Studio Marketplace. + +## Future improvements: +- Need to cache the list of files in the solution so it doesn't have to re-parse them every time. This means updating the cached list when new files/projects are added or loaded. +- More options for controlling how files are listed and searched, such as the ability to only search through open files. +