Hi,
SortUsings behaves differently in editor quick fix and save file action.
Sorting in the editor using quick fix:
settings.json
This
namespace X;
using SofteraBaltic.C;
using Microsoft.B;
using System.A;
is sorted like this using a "light bulb"
namespace X;
using System.A;
using Microsoft.B;
using SofteraBaltic.C;
which is correct order.
Sorting using file save action:
settings.json
This
namespace X;
using SofteraBaltic.C;
using Microsoft.B;
using System.A;
is sorted like this when saving the file:
namespace X;
using Microsoft.B;
using SofteraBaltic.C;
using System.A;
which is just alphabetical order.
Using SortUsings as part as code cleanup works as expected.
It seems that SortUsings in alOutline.codeActionsOnSave does not consider the workspace settings - removing all workspace settings and using Sort usings quck fix gives the second result.
Here is a simple project without any dependencies for reproducing the problem:
Repro.zip
Thanks.
Hi,
SortUsings behaves differently in editor quick fix and save file action.
Sorting in the editor using quick fix:
settings.json
{ // "editor.codeActionsOnSave": { // "source.fixAll.al": "explicit", // }, "alOutline.namespacesSortOrder": [ "System", "Microsoft", "SofteraBaltic", ], // "alOutline.codeActionsOnSave": [ // "SortUsings", // ], }This
is sorted like this using a "light bulb"
which is correct order.
Sorting using file save action:
settings.json
{ "editor.codeActionsOnSave": { "source.fixAll.al": "explicit", }, "alOutline.namespacesSortOrder": [ "System", "Microsoft", "SofteraBaltic", ], "alOutline.codeActionsOnSave": [ "SortUsings", ], }This
is sorted like this when saving the file:
which is just alphabetical order.
Using SortUsings as part as code cleanup works as expected.
It seems that SortUsings in alOutline.codeActionsOnSave does not consider the workspace settings - removing all workspace settings and using Sort usings quck fix gives the second result.
Here is a simple project without any dependencies for reproducing the problem:
Repro.zip
Thanks.