-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Overview
I want my usings in the following order:
- System
- Microsoft
- 3rd Party packages
- My own namespaces
- using static namespaces
To achieve this I created 5 groups, 4 of which are trivial, because they are simply StatsWith and constant value. However in order to place all 3rd party package usings I tried to use a regex, which does not match any of the other groups.
When I used the hotkey to format the usings the 3rd party ones were ordered last, When I opened the settings again I was intrigued to see that my group rule is completely gone. So I tested it:
- Create a new rule, chose
MatchRegexand pass in^[^.]+?(using (?!System)(?!Microsoft)(?!Interactive\.)(?!static)[A-Z]{1}.*)$asValue - Save settings
- Use format hotkey
- Open settings again
The newly created rule is gone.
This does not happen for all regex values. For example the rule did not go away with .+?using AutoMapper;.
Sample namespaces I tested with:
using Microsoft.AspNetCore.Mvc;
using AutoMapper;
using Interactive.Servers.Controllers;
using Interactive.Servers.Extensions;
using Microsoft.Extensions.Logging;
using Interactive.Servers.Lms.Models;
using System.Threading.Tasks;
using Interactive.Servers.Lms.Models.Exams;
using Interactive.Services.Lms.Business;
using static Interactive.Servers.ServerConstants;
using Interactive.Services.Mapping;Metadata
Metadata
Assignees
Labels
No labels