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++) 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. +