Rider Code Cleanup Auto Indenting on Comments

So I tried asking this on stack overflow and got nothing but insults over my choice of how I use comments in my code, hoping it will be better here. All I want to know is how to stop the code cleanup feature changing my comment indentation.

Appologies for my rant but it is very frustrating when you ask for help on something and get nothing but insults even going as far as to say that I used AI to generate it…

Code cleanup changes my comment indentation from this:

switch (PlayerController->IsPaused())
		{
			// Game is currently unpaused.
			case false:
				GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, "false");
				// Pause the game.
				UGameplayStatics::SetGamePaused(GetWorld(), true);

				// Create the widget
				PauseMenuInstance = CreateWidget<UPauseMenu>(PlayerController, PauseMenu);

				// Add to player screen
				PauseMenuInstance->AddToPlayerScreen();
				break;


			// Game is currently paused.
			case true:
				GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, "true");
				// Unpause the game.
				UGameplayStatics::SetGamePaused(GetWorld(), false);

				// Remove from player screen
				PauseMenuInstance->RemoveFromParent();
				break;
		}

To this:

switch (PlayerController->IsPaused())
		{
			// Game is currently unpaused.
			case false:
				GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, "false");
			// Pause the game.
				UGameplayStatics::SetGamePaused(GetWorld(), true);

			// Create the widget
				PauseMenuInstance = CreateWidget<UPauseMenu>(PlayerController, PauseMenu);

			// Add to player screen
				PauseMenuInstance->AddToPlayerScreen();
				break;


			// Game is currently paused.
			case true:
				GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, "true");
			// Unpause the game.
				UGameplayStatics::SetGamePaused(GetWorld(), false);

			// Remove from player screen
				PauseMenuInstance->RemoveFromParent();
				break;
		}
0
1 comment

Hello,

Thank you for contacting Rider support. I registered this issue: RSCPP-36611 Comment indents wrong under 'case' with several rows non-wrapped with '{', '}'
Meantime, you might want to wrap several commands under case condition into '{}'. As a workaround + for readability purpose:

case false: {
…
}

Have a nice day!

0

Please sign in to leave a comment.