@@ -81,11 +81,23 @@ OnLoaded="(e) => SetLuminanceAsync(e.IsDark)" OnLuminanceChanged="(e) => SetLumi
8181 <h5 style =" margin : 0.75rem 0 0 0 " >Compilers</h5 >
8282
8383 @* SDK version select *@
84- <FluentTextField @bind-Value =" sdkVersion" @bind-Value:after =" () => LoadSdkInfoAsync()"
85- Placeholder =" version" Style =" width: 100%" >
84+ <FluentComboboxEx @bind-Value =" sdkVersion" @bind-Value:after =" () => LoadSdkInfoAsync()"
85+ Autocomplete = " ComboboxAutocomplete.Both " Placeholder =" version" Style =" width: 100%" >
8686 <FluentLabel slot =" start" >SDK</FluentLabel >
87+ @foreach ( var info in sdkVersions ?? [])
88+ {
89+ <FluentOption TOption =" string" Value =" @info.Version" >
90+ @info.Version
91+ @*
92+ For some reason, we cannot customize the text displayed in the closed combo box after selection
93+ and we don't want it to contain the additional info, so we use this as a workaround.
94+ `option-badge` is a CSS class which puts the `data-text` into `content` of `::after` pseudo-element.
95+ *@
96+ <span class =" option-badge" data-text =" @info.ReleaseDate" ></span >
97+ </FluentOption >
98+ }
8799 <FluentProgressRing slot =" end" title =" Loading info..." Visible =" loadingSdkInfo" Width =" 1em" />
88- </FluentTextField >
100+ </FluentComboboxEx >
89101 <FluentLabel Style =" opacity: 80%" >
90102 Enter a .NET SDK version above to automatically get
91103 the corresponding Roslyn and Razor version numbers below.
@@ -283,6 +295,7 @@ OnLoaded="(e) => SetLuminanceAsync(e.IsDark)" OnLuminanceChanged="(e) => SetLumi
283295 private string ? sdkVersion , roslynVersion , razorVersion ;
284296 private BuildConfiguration roslynConfiguration , razorConfiguration ;
285297 private bool loadingSdkInfo , loadingRoslynInfo , loadingRazorInfo ;
298+ private List < SdkVersionInfo > ? sdkVersions ;
286299 private SdkInfo ? sdkInfo ;
287300 private CompilerDependencyInfo ? roslynInfo , razorInfo ;
288301 private string ? sdkError , roslynError , razorError ;
@@ -441,10 +454,16 @@ OnLoaded="(e) => SetLuminanceAsync(e.IsDark)" OnLuminanceChanged="(e) => SetLumi
441454 modalHidden = false ;
442455 StateHasChanged ();
443456
457+ Task sdkVersionsTask = Task .CompletedTask ;
444458 Task sdkTask = Task .CompletedTask ;
445459 Task roslynTask = Task .CompletedTask ;
446460 Task razorTask = Task .CompletedTask ;
447461
462+ if (sdkVersions is null )
463+ {
464+ sdkVersionsTask = LoadSdkVersionsAsync ();
465+ }
466+
448467 if (sdkInfo is null )
449468 {
450469 sdkTask = LoadSdkInfoAsync (saveState : false );
@@ -460,7 +479,7 @@ OnLoaded="(e) => SetLuminanceAsync(e.IsDark)" OnLuminanceChanged="(e) => SetLumi
460479 razorTask = LoadRazorInfoAsync (saveState : false );
461480 }
462481
463- return Task .WhenAll (sdkTask , roslynTask , razorTask );
482+ return Task .WhenAll (sdkVersionsTask , sdkTask , roslynTask , razorTask );
464483 }
465484
466485 public void CloseModal ()
@@ -503,6 +522,12 @@ OnLoaded="(e) => SetLuminanceAsync(e.IsDark)" OnLuminanceChanged="(e) => SetLumi
503522 return Task .WhenAll (sdkTask , roslynTask , razorTask );
504523 }
505524
525+ private async Task LoadSdkVersionsAsync ()
526+ {
527+ sdkVersions = await Worker .GetSdkVersionsAsync ();
528+ await RefreshAsync ();
529+ }
530+
506531 private async Task LoadSdkInfoAsync (bool saveState = true )
507532 {
508533 var versionToLoad = sdkVersion ;
@@ -540,7 +565,7 @@ OnLoaded="(e) => SetLuminanceAsync(e.IsDark)" OnLuminanceChanged="(e) => SetLumi
540565 catch (Exception ex )
541566 {
542567 Logger .LogError (ex , " Failed to load SDK info." );
543- error = ex .Message ;
568+ error = ex is WorkerException w ? w . Failure . Message : ex .Message ;
544569 info = null ;
545570 }
546571
0 commit comments