Skip to content

Commit c4fab56

Browse files
committed
- Renamed Config.HideDevaultAssemblies -> Config.HideDefaultAssemblies.
- Assembly references in the project tree are now ordered.
1 parent 03c6b1b commit c4fab56

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/CSScriptNpp/CSScriptNpp/CSScriptHelper.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,11 +650,25 @@ static public Project GenerateProjectFor(string script)
650650
oldNotificationMessage = NotifyClient("Processing NuGet packages...");
651651
}
652652

653-
if (Config.Instance.HideDevaultAssemblies)
653+
if (Config.Instance.HideDefaultAssemblies)
654654
retval.Assemblies = parser.AgregateReferences(searchDirs, new string[0], new string[0]).ToArray();
655655
else
656656
retval.Assemblies = parser.AgregateReferences(searchDirs, defaultRefAsms, defaultNamespaces).ToArray();
657657

658+
// order:
659+
// - non GAC
660+
// - System.dll
661+
// - All other System.*
662+
// and then alphabetically within each group
663+
664+
retval.Assemblies = retval.Assemblies
665+
.Select(x=> new { Name = Path.GetFileName(x), File = x } )
666+
.OrderBy(x => x.Name == "System.dll" ? 1 :
667+
x.Name.StartsWith("System.") ? 2 :
668+
0)
669+
.ThenBy(x => x.Name)
670+
.Select(x=>x.File)
671+
.ToArray();
658672
return retval;
659673
}
660674
finally

src/CSScriptNpp/CSScriptNpp/Config.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public string GetFileName()
6363
public string UseCustomLauncher = "";
6464
public bool StartRoslynServerAtNppStartup = true;
6565
public bool ImproveWin10ListVeiwRendering = true;
66-
public bool HideDevaultAssemblies = true;
66+
public bool HideDefaultAssemblies = true;
6767
public bool WordWrapInVisualizer = true;
6868
public bool ListManagedProcessesOnly = true;
6969
public bool RunExternalInDebugMode = true;
@@ -153,7 +153,7 @@ public void Save()
153153
SetValue(Section, nameof(UseRoslynProvider), UseRoslynProvider);
154154
SetValue(Section, nameof(StartRoslynServerAtNppStartup), StartRoslynServerAtNppStartup);
155155
SetValue(Section, nameof(ImproveWin10ListVeiwRendering), ImproveWin10ListVeiwRendering);
156-
SetValue(Section, nameof(HideDevaultAssemblies), HideDevaultAssemblies);
156+
SetValue(Section, nameof(HideDefaultAssemblies), HideDefaultAssemblies);
157157
SetValue(Section, nameof(RestorePanelsAtStartup), RestorePanelsAtStartup);
158158
SetValue(Section, nameof(UseCustomLauncher), UseCustomLauncher);
159159
SetValue(Section, nameof(UpdateMode), UpdateMode);
@@ -241,7 +241,7 @@ public void Open()
241241
RestorePanelsAtStartup = GetValue(Section, nameof(RestorePanelsAtStartup), RestorePanelsAtStartup);
242242
UseCustomLauncher = GetValue(Section, nameof(UseCustomLauncher), UseCustomLauncher);
243243
ImproveWin10ListVeiwRendering = GetValue(Section, nameof(ImproveWin10ListVeiwRendering), ImproveWin10ListVeiwRendering);
244-
HideDevaultAssemblies = GetValue(Section, nameof(HideDevaultAssemblies), HideDevaultAssemblies);
244+
HideDefaultAssemblies = GetValue(Section, nameof(HideDefaultAssemblies), HideDefaultAssemblies);
245245
UpdateMode = GetValue(Section, nameof(UpdateMode), UpdateMode);
246246
VSProjectTemplatePath = GetValue(Section, nameof(VSProjectTemplatePath), VSProjectTemplatePath);
247247
FloatingPanelsWarningAlreadyPropted = GetValue(Section, nameof(FloatingPanelsWarningAlreadyPropted), FloatingPanelsWarningAlreadyPropted);

0 commit comments

Comments
 (0)