Snap just auto updated to 2022.3 and changed my settings

When I open it up this morning I got a notification that snap has updated to the latest version.

When I went to format some html it had changed my settings to format attributes on a newline. It has also changed the way classes are formatted. Now when my colleague who uses the exact same formatting I setup formats his code I get crazy merge conflicts with git.

If I setup the code formatting on the IDE across all projects, why would you guys change them to what you think I should have them to?

And what else has changed?

16 comments
Comment actions Permalink

How to stop formatting like this

Games::where('id', $game_id)
->update([
"date" => $request->input('date'),
"time" => $request->input('time'),
"team_a" => $request->input('team_a'),
"team_a_score" => $request->input('team_a_score'),
"team_b" => $request->input('team_b'),
"team_b_score" => $request->input('team_b_score'),
"tournament_id" => $request->input('tournament_id'),
]);

And change to this

Games::where('id', $game_id)
->update([
"date" => $request->input('date'),
"time" => $request->input('time'),
"team_a" => $request->input('team_a'),
"team_a_score" => $request->input('team_a_score'),
"team_b" => $request->input('team_b'),
"team_b_score" => $request->input('team_b_score'),
"tournament_id" => $request->input('tournament_id'),
]);
0
Comment actions Permalink

How to stop formatting like this

$game = new Games();
$game->name = $request->input('name');
$game->start_date = $request->input('start_date');
$game->end_date = $request->input('end_date');
$game->save();

And format like this

$game = new Games();
$game->name = $request->input('name');
$game->start_date = $request->input('start_date');
$game->end_date = $request->input('end_date');
$game->save();
0
Comment actions Permalink

How to stop formatting like this

$games = Games::where('tournament_id', $tournament_id)
->
orderBy('date')->get();

And format like this

$games = Games::where('tournament_id', $tournament_id)
->orderBy('date')
->get();
0
Comment actions Permalink

Technically, nothing should change in terms of formatting after the IDE update. Do you use Settings Sync by the chance?

As for the specific examples, these are controlled by:

1. PHP > Wrapping and Braces > Array initializer > Align key-value pairs;

2. PHP > Wrapping and Braces > Assignment statement > Align consecutive assignments;

3. PHP > Wrapping and Braces > Chained method calls > Align when multiline, Wrap always;

0
Comment actions Permalink

Yes I am using Setting Sync and everything is set to be synced. This may have happened when I tested out the new ui. All of my colours are intact. it seems to be the formatting that has been changed so far.

This incident happed on my work pc which synced to the cloud and then to my home pc.

Thanks for the formatting directions. It's not so straightforward navigating/googling the formatting settings.

0
Comment actions Permalink

I have had sync set up for a long time so why when I fix the issues above at home and them come to work I have to fix them again?

What extra steps do I have to do now? These updates bring more problems than I had in the first place.

I didn't even want to update!

 

0
Comment actions Permalink

So it appears that 2022.3 has synced the messed up formatting settings last Friday, but cannot pull down changes I made at the weekend on my home PC. I also don't see the cloud icon at the bottom right on 2022.3

I really need to get on with work instead tweaking settings

 

0
Comment actions Permalink

It appears sync is no longer working as changes I make on home and work do not sync and I can no longer see the blue cloud icon since updating to 2022.3.

Has anything changed regarding this and how do I make sure it is syncing?

0
Comment actions Permalink

It seems that 

// @formatter:off

no longer works either. Is there any way that this was also switched off with the update?

0
Comment actions Permalink

The formatter marker is disabled by default. You may enable it with the "Preferences/Settings | Editor | Code Style > Formatter > Turn formatter on/off markers":

As for the Settings Sync, there is no more cloud icon in the status bar as this feature has been reworked and it is not just a plugin but an included feature. Please check "Settings / Preferences | Settings Sync" settings window, do you have anything configured there?

0
Comment actions Permalink

Vasiliy Yur so I am correct in saying you have reset all my formatting settings.

0
Comment actions Permalink

Of course, IDE should not reset formatting settings on its own but in some bug cases, it may happen.
For instance, there was an issue on one of the 2022.3 EAP builds where Settings Sync feature has just been introduced but not included in PhpStorm whereas an older plugin did not work anymore there. This situation caused IDE to use default settings location (old settings were intact but not used).

There is a difference in settings storage place with and without Settings Sync, for Linux it looks like:
- Default, no settings sync: ~/.config/JetBrains/PhpStorm2022.3/options (or ~/.config/JetBrains/PhpStorm2022.2/options for previous build)
- Old IDE Settings Sync plugin, before the 2022.3 update: ~/.config/JetBrains/PhpStorm2022.2/jba_config 
- New Settings Sync feature since 2022.3: ~/.config/JetBrains/PhpStorm2022.3/settingsSync/options

Basically, if you use IDE Settings Sync in previous version, the 2022.3 installation should migrate your settings to the new plugin automatically. But as I may only suspect, for some reason it did not happen in your case.

Please check all the locations from the list above, do you have anything there?

0
Comment actions Permalink

Vasiliy Yur OK I found the old folder. I copied it over, but don't see any difference when I am formatting. I am still seeing default behaviors.

What is the logic behind the following formating?

<div class="flex gap-2 flex-wrap mt-8">
<x-button-link href="{{route('debtors.create')}}" class="dark:bg-gray-600">
New debtor</x-button-link>
<x-button-link href="{{route('debtor_invoices.create')}}" class="dark:bg-gray-600">
New invoice
</x-button-link>
<x-button-link href="{{route('debtor_invoices.index')}}" class="dark:bg-gray-600">Debtor
Invoices
</x-button-link>
</div>

 

And how do I know if it has synced? I am having to redo these settings from one PC to another.

I really need a solid way of syncing up my setting and not losing precious dev time making sure you guys don't cause mayhem in merge conflicts

0
Comment actions Permalink

I have checked your code sample on my installation with the default code style and in my case, only "</x-button-link>" on a third line moved to the next line. Apart from this, the formatting seems to be default, am I missing something?

Would it be possible to share your old config folder, so I could take a closer look on your Code Style settings?
You may use JetBrains upload services to share these in private:
https://uploads.jetbrains.com/

As for the solid way of settings synchronization, if Settings Sync does not work well for you, you may export/import settings manually (Settings Sync should be disabled though):
https://www.jetbrains.com/help/phpstorm/sharing-your-ide-settings.html#import-export-settings

0
Comment actions Permalink

How do I stop this happening. Firstly the class on a second line and second the closing arrow on a new line too.

```html

<label
for="country218" class="flex gap-2 items-center flex-grow border border-gray-200 dark:border-gray-600 p-2 dark:text-gray-400 font-light
cursor-pointer"
>

```

0
Comment actions Permalink

Have you tried setting "No wrap" in "Settings/Preferences | Editor | Code Style | HTML > Other > Wrap attributes"?

0

Please sign in to leave a comment.