You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
------------------- Please fill in this section -------------------------
Format the following code with aspnetcorerazor formatter and multiple lines will be partially pulled out of comments causing various errors. In particular the IsSpotifyAuthenticated definition.
@page "/shuffle"
@inject NavigationManagerNavigationManager// For potential future redirects
@* @inject SpotifyPlaylistShuffler PlaylistShuffler // We'll uncomment this later
@inject IHttpContextAccessor HttpContextAccessor // To check for auth *@<h3>Shuffle Spotify Playlist</h3>
@* We'll add a check here later to only show thisif the user is authenticated *@
@*@if(IsSpotifyAuthenticated)*@
@*{*@
<div class="mb-3"><label for="playlistUrlOrId"class="form-label">Spotify Playlist URL or ID:</label><input type="text" class="form-control"id="playlistUrlOrId"@bind="PlaylistUrlOrId"placeholder="Enter Spotify Playlist URL or ID"/></div><button class="btn btn-primary"@onclick="HandleShufflePlaylist"disabled="@IsShuffling">@if(IsShuffling){<span class="spinner-border spinner-border-sm"role="status" aria-hidden="true"></span><span>Shuffling...</span>}else{<span>Shuffle Playlist</span>}</button>@if(!string.IsNullOrEmpty(StatusMessage)){<div class="mt-3 alert @(IsError ? "alert-danger" : "alert-success")"role="alert">@StatusMessage
@if (!string.IsNullOrEmpty(NewPlaylistLink)){<p>View your new playlist:<a href="@NewPlaylistLink" target="_blank">@NewPlaylistLink</a></p>}</div>}
@*}*@
@*else*@
@*{*@
@*<p>Please<a href="/">loginwith Spotify</a>firsttousethis feature.</p>*@
@*}*@
@code{private string? PlaylistUrlOrId {get;set;}
private bool IsShuffling {get;set;}= false;
private string? StatusMessage {get;set;}
private bool IsError {get;set;}=false;
private string? NewPlaylistLink {get;set;}// To store the link to the new playlist// private bool IsSpotifyAuthenticated => !string.IsNullOrEmpty(HttpContextAccessor.HttpContext?.Session?.GetString("Spotify_AccessToken"));
private asyncTaskHandleShufflePlaylist(){IsShuffling=true;StatusMessage="Starting shuffle process...";IsError=false;NewPlaylistLink=null;StateHasChanged();// Update UI to show spinnerif(string.IsNullOrWhiteSpace(PlaylistUrlOrId)){StatusMessage="Playlist URL or ID cannot be empty.";IsError=true;IsShuffling=false;return;}// Dummy delay to simulate work - replace with actual service callawaitTask.Delay(2000);// --- This is where we will call the service ---// try// {// (bool success, string message, string? newPlaylistUrl) = await PlaylistShuffler.ShufflePlaylistAsync(PlaylistUrlOrId, CancellationToken.None);// StatusMessage = message;// IsError = !success;// NewPlaylistLink = newPlaylistUrl;// }// catch (Exception ex)// {// StatusMessage = $"An unexpected error occurred: {ex.Message}";// IsError = true;// }// finally// {// IsShuffling = false;// }// --- Placeholder for now ---StatusMessage="Shuffle process would happen here. Service call is commented out.";// IsError = false; // Or true if simulating an error// NewPlaylistLink = "https://open.spotify.com/playlist/yourNewPlaylistID"; // Simulate linkIsShuffling=false;// --- End Placeholder ---StateHasChanged();// Update UI with result}}
Description of the problem:
------------------- Please fill in this section -------------------------
Expected behavior: Don't break the syntax of the code.
Actual behavior: Formatter breaks the code so it no longer compiles.
Screen recording from just hitting save:
Screen.Recording.2025-05-08.at.6.45.37.PM.mov
Logs
OmniSharp
------------------- Please fill in this section -------------------------
To find the OmniSharp log, open VS Code's "Output" pane, then in the dropdown choose "OmniSharp Log".
There is no OmniSharp log.
Razor
Expand
-- Starting Issue Data Collection--
1101 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '51'.'
1101 - Projected document in sync with host document
1101 - Projected text document in sync with data type
1101 - Synchronization successful!
1102 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '51'.'
1102 - Projected document in sync with host document
1102 - Projected text document in sync with data type
1102 - Synchronization successful!
1103 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '51'.'
1103 - Projected document in sync with host document
1103 - Projected text document in sync with data type
1103 - Synchronization successful!
1104 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '51'.'
1104 - Projected document in sync with host document
1104 - Projected text document in sync with data type
1104 - Synchronization successful!
1105 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '51'.'
1105 - Projected document in sync with host document
1105 - Projected text document in sync with data type
1105 - Synchronization successful!
1106 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '51'.'
1106 - Projected document in sync with host document
1106 - Projected text document in sync with data type
1106 - Synchronization successful!
1107 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '51'.'
1107 - Projected document in sync with host document
1107 - Projected text document in sync with data type
1107 - Synchronization successful!
1108 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '51'.'
1108 - Projected document in sync with host document
1108 - Projected text document in sync with data type
1108 - Synchronization successful!
1109 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.html':
Currently at 51, synchronizing to version '51'.'
1109 - Projected document in sync with host document
1109 - Projected text document in sync with data type
1109 - Synchronization successful!
1110 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 51, synchronizing to version '52'.'
1110 - Projected document not in sync with host document, waiting for update...
Current host document sync version: 51
Updating the HTML document for Razor file '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor' (52)
Notifying document '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor' changed 'htmlChanged' with '9' changes.
Updating the C# document for Razor file '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor' (52)
Notifying document '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor' changed 'csharpChanged' with '21' changes.
1110 - Projected document in sync with host document
1110 - Projected text document not in sync with data type, waiting for update...
Current projected text document sync version: 51
1111 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1111 - Projected document in sync with host document
1111 - Projected text document not in sync with data type, waiting for update...
Current projected text document sync version: 51
1110 - Projected text document synchronized to 52.
1111 - Projected text document synchronized to 52.
1110 - Projected text document in sync with data type
1110 - Synchronization successful!
1111 - Projected text document in sync with data type
1111 - Synchronization successful!
1112 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1112 - Projected document in sync with host document
1112 - Projected text document in sync with data type
1112 - Synchronization successful!
1113 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1113 - Projected document in sync with host document
1113 - Projected text document in sync with data type
1113 - Synchronization successful!
1114 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1114 - Projected document in sync with host document
1114 - Projected text document in sync with data type
1114 - Synchronization successful!
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[111, 46], [111, 67]].
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[153, 39], [153, 54]].
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[128, 31], [128, 44]].
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[214, 23], [214, 44]].
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[163, 53], [163, 68]].
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[146, 13], [146, 26]].
Re-mapping location [[138, 33], [138, 40]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[30, 33], [30, 40]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[171, 87], [171, 102]].
Re-mapping location [[208, 20], [208, 33]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[48, 20], [48, 33]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Re-mapping location [[209, 17], [209, 24]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[49, 17], [49, 24]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Re-mapping location [[217, 8], [217, 21]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[57, 8], [57, 21]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Re-mapping location [[210, 20], [210, 35]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[50, 20], [50, 35]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Re-mapping location [[218, 8], [218, 15]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[58, 8], [58, 15]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[224, 12], [224, 25]].
Re-mapping location [[225, 12], [225, 19]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[65, 12], [65, 19]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Re-mapping location [[219, 8], [219, 23]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[59, 8], [59, 23]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Unable to remap file /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs at [[252, 8], [252, 21]].
1115 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1115 - Projected document in sync with host document
1115 - Projected text document in sync with data type
1115 - Synchronization successful!
1116 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1116 - Projected document in sync with host document
1116 - Projected text document in sync with data type
1116 - Synchronization successful!
1117 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1117 - Projected document in sync with host document
1117 - Projected text document in sync with data type
1117 - Synchronization successful!
1118 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1118 - Projected document in sync with host document
1118 - Projected text document in sync with data type
1118 - Synchronization successful!
1119 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1119 - Projected document in sync with host document
1119 - Projected text document in sync with data type
1119 - Synchronization successful!
1120 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1120 - Projected document in sync with host document
1120 - Projected text document in sync with data type
1120 - Synchronization successful!
1121 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.html':
Currently at 52, synchronizing to version '52'.'
1121 - Projected document in sync with host document
1121 - Projected text document in sync with data type
1121 - Synchronization successful!
1122 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1122 - Projected document in sync with host document
1122 - Projected text document in sync with data type
1122 - Synchronization successful!
1123 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1123 - Projected document in sync with host document
1123 - Projected text document in sync with data type
1123 - Synchronization successful!
1124 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1124 - Projected document in sync with host document
1124 - Projected text document in sync with data type
1124 - Synchronization successful!
Re-mapping location [[111, 42], [111, 63]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[16, 42], [16, 63]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Re-mapping location [[215, 19], [215, 40]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[55, 19], [55, 40]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
Re-mapping location [[213, 8], [213, 21]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs to [[53, 8], [53, 21]] in /Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor
1125 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1125 - Projected document in sync with host document
1125 - Projected text document in sync with data type
1125 - Synchronization successful!
1126 - Synchronizing '/Users/anonymous/Source/UltimateJukebox/src/UltimateJukebox.Shared/Components/Pages/ShufflePlaylist.razor__virtual.cs':
Currently at 52, synchronizing to version '52'.'
1126 - Projected document in sync with host document
1126 - Projected text document in sync with data type
1126 - Synchronization successful!
-- Stopping Issue Data Collection--
Workspace information
Razor document:
Expand
@page "/shuffle"@inject NavigationManagerNavigationManager // Forpotentialfutureredirects@* @inject SpotifyPlaylistShuffler PlaylistShuffler // We'll uncomment this later@inject IHttpContextAccessor HttpContextAccessor // To check for auth *@
<h3>Shuffle Spotify Playlist</h3>
@* We'll add a check here later to only show this if the user is authenticated *@@* @if (IsSpotifyAuthenticated) *@@* { *@
<divclass="mb-3">
<labelfor="playlistUrlOrId"class="form-label">Spotify Playlist URL or ID:</label>
<inputtype="text"class="form-control"id="playlistUrlOrId"@bind="PlaylistUrlOrId"placeholder="Enter Spotify Playlist URL or ID" />
</div>
<buttonclass="btn btn-primary"@onclick="HandleShufflePlaylist"disabled="@IsShuffling">
@if (IsShuffling)
{
<spanclass="spinner-border spinner-border-sm"role="status"aria-hidden="true"></span>
<span> Shuffling...</span>
}else{
<span>ShufflePlaylist</span>
}
</button>
@if (!string.IsNullOrEmpty(StatusMessage))
{
<divclass="mt-3 alert @(IsError ? "alert-danger" : "alert-success")"role="alert">
@StatusMessage@if (!string.IsNullOrEmpty(NewPlaylistLink))
{
<p>Viewyournewplaylist: <ahref="@NewPlaylistLink"target="_blank">@NewPlaylistLink</a></p>
}
</div>
}@* } *@@* else *@@* { *@@* <p>Please <a href="/">log in with Spotify</a> first to use this feature.</p> *@@* } *@@code{privatestring?PlaylistUrlOrId{get; set; }privateboolIsShuffling{get; set; }=false;
privatestring?StatusMessage{get; set; }privateboolIsError{get; set; }=false;
privatestring?NewPlaylistLink{get; set; }// To store the link to the new playlist// private bool IsSpotifyAuthenticated =>!string.IsNullOrEmpty(HttpContextAccessor.HttpContext?.Session?.GetString("Spotify_AccessToken"));
privateasyncTaskHandleShufflePlaylist()
{IsShuffling=true;
StatusMessage="Starting shuffle process...";
IsError=false;
NewPlaylistLink=null;
StateHasChanged(); // Update UI to show spinnerif (string.IsNullOrWhiteSpace(PlaylistUrlOrId))
{
StatusMessage="Playlist URL or ID cannot be empty.";
IsError=true;
IsShuffling=false;
return;
}
// Dummy delay to simulate work - replace with actual service callawaitTask.Delay(2000);
// --- This is where we will call the service ---// try// {// (bool success, string message, string? newPlaylistUrl) = await PlaylistShuffler.ShufflePlaylistAsync(PlaylistUrlOrId,CancellationToken.None);
// StatusMessage = message;// IsError = !success;// NewPlaylistLink = newPlaylistUrl;// }// catch (Exception ex)// {// StatusMessage = $"An unexpected error occurred: {ex.Message}";// IsError = true;// }// finally// {// IsShuffling = false;// }// --- Placeholder for now ---StatusMessage="Shuffle process would happen here. Service call is commented out.";
// IsError = false; // Or true if simulating an error// NewPlaylistLink = "https://open.spotify.com/playlist/yourNewPlaylistID"; // Simulate linkIsShuffling=false;
// --- End Placeholder ---StateHasChanged(); // Update UI with result}}
@Laptop765 thanks for logging this. I thought we had a duplicate issue, but I can't find it, so will leave this open.
This is caused by the VS Code html formatter automatically wrapping long lines, with the default being at 120 characters. The line that is breaking is 126 characters long.
As a workaround until we can get a fix, you can turn that off by setting the Html Wrap Line Length setting to 0:
Is this a Bug or Feature request?:
Bug
Steps to reproduce:
------------------- Please fill in this section -------------------------
Format the following code with
aspnetcorerazor
formatter and multiple lines will be partially pulled out of comments causing various errors. In particular theIsSpotifyAuthenticated
definition.Description of the problem:
------------------- Please fill in this section -------------------------
Expected behavior: Don't break the syntax of the code.
Actual behavior: Formatter breaks the code so it no longer compiles.
Screen recording from just hitting save:
Screen.Recording.2025-05-08.at.6.45.37.PM.mov
Logs
OmniSharp
------------------- Please fill in this section -------------------------
To find the OmniSharp log, open VS Code's "Output" pane, then in the dropdown choose "OmniSharp Log".
There is no
OmniSharp
log.Razor
Expand
Workspace information
Razor document:
Expand
Projected CSharp document:
Expand
Projected Html document:
Expand
Machine information
VSCode version: 1.99.3
Razor.VSCode version: 2.72.34
dotnet --info
Expand
Extensions
Expand
The text was updated successfully, but these errors were encountered: