-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Support batch PDB generation. #3619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
3ee07e4
ef52899
71cfce3
c5c3505
1f13b80
cae0022
cfc5d2f
e807f1a
5625db2
a973b2e
e027a1a
752e6ed
b631b55
da6d257
4e5727f
217c72d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -47,19 +47,30 @@ class GeneratePdbContextMenuEntry(LanguageService languageService, DockWorkspace | |||||
| { | ||||||
| public void Execute(TextViewContext context) | ||||||
| { | ||||||
| var assembly = (context.SelectedTreeNodes?.FirstOrDefault() as AssemblyTreeNode)?.LoadedAssembly; | ||||||
| if (assembly == null) | ||||||
| var selectedNodes = context.SelectedTreeNodes?.OfType<AssemblyTreeNode>().ToArray(); | ||||||
| if (selectedNodes == null || selectedNodes.Length == 0) | ||||||
| return; | ||||||
| GeneratePdbForAssembly(assembly, languageService, dockWorkspace); | ||||||
|
|
||||||
| if (selectedNodes.Length == 1) | ||||||
| { | ||||||
| var assembly = selectedNodes.First().LoadedAssembly; | ||||||
| if (assembly == null) | ||||||
| return; | ||||||
| GeneratePdbForAssembly(assembly, languageService, dockWorkspace); | ||||||
| } | ||||||
| else | ||||||
| { | ||||||
| GeneratePdbForAssemblies(selectedNodes.Select(n => n.LoadedAssembly), languageService, dockWorkspace); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| public bool IsEnabled(TextViewContext context) => true; | ||||||
|
|
||||||
| public bool IsVisible(TextViewContext context) | ||||||
| { | ||||||
| return context.SelectedTreeNodes?.Length == 1 | ||||||
| && context.SelectedTreeNodes?.FirstOrDefault() is AssemblyTreeNode tn | ||||||
| && tn.LoadedAssembly.IsLoadedAsValidAssembly; | ||||||
| var selectedNodes = context.SelectedTreeNodes; | ||||||
| return selectedNodes?.Any() == true | ||||||
| && selectedNodes.All(n => n is AssemblyTreeNode asm && asm.LoadedAssembly.IsLoadedAsValidAssembly); | ||||||
| } | ||||||
|
|
||||||
| internal static void GeneratePdbForAssembly(LoadedAssembly assembly, LanguageService languageService, DockWorkspace dockWorkspace) | ||||||
|
|
@@ -105,6 +116,109 @@ internal static void GeneratePdbForAssembly(LoadedAssembly assembly, LanguageSer | |||||
| return output; | ||||||
| }, ct)).Then(dockWorkspace.ShowText).HandleExceptions(); | ||||||
| } | ||||||
|
|
||||||
| internal static void GeneratePdbForAssemblies(System.Collections.Generic.IEnumerable<LoadedAssembly> assemblies, LanguageService languageService, DockWorkspace dockWorkspace) | ||||||
| { | ||||||
| var assemblyArray = assemblies?.Where(a => a != null).ToArray(); | ||||||
siegfriedpammer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| if (assemblyArray == null || assemblyArray.Length == 0) | ||||||
|
||||||
| if (assemblyArray == null || assemblyArray.Length == 0) | |
| if (assemblyArray.Length == 0) |
siegfriedpammer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
siegfriedpammer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
sonyps5201314 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
siegfriedpammer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The progress title "Generating portable PDB..." is hardcoded and not localized. Consider adding this string to the resource files for proper internationalization, similar to other user-facing messages in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sonyps5201314 if you want, you can add this. There are other locations where this same string is used, that might need updating as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
71cfce3 resolved.
Outdated
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using /select with a folder path (targetFolder) will not work as intended. The /select parameter expects a file path to select in Explorer. To open the folder directly, use:
Process.Start("explorer", "\"" + targetFolder + "\"");This will open the target folder itself, which is more appropriate for a batch operation where multiple files were generated.
| output.AddButton(null, Resources.OpenExplorer, delegate { Process.Start("explorer", "/select,\"" + targetFolder + "\""); }); | |
| output.AddButton(null, Resources.OpenExplorer, delegate { Process.Start("explorer", "\"" + targetFolder + "\""); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sonyps5201314 Yes, this a legitimate bug: explorer C:\path\to\folder is the syntax for folders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1f13b80 resolved.
This also incidentally resolves another small 'unmodern' issue in ILSpy: every time 'Open or Select File/Folder' was executed, a new explorer.exe process was launched, and these processes would not automatically exit even after closing the opened windows.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.