As far as I can gather it is not possible to group by prefixes. You can only group by extensions or suffixes, or entire file names.
This means you can't define a rule for this. However there are 2 options:
- Define a rule for each file
- Change your naming scheme
Defining a rule for each file
To define a rule for each file you would use the fileToFile provider.
This would look like so:
{
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"root": true,
"dependentFileProviders": {
"add": {
"fileToFile": {
"add": {
"IInvestigationRepository.cs": [ // Parent file
"InvestigationRepository.cs" // Nested file
],
"IReporterRepository.cs": [ // Parent file
"ReporterRepository.cs" // Nested file
]
...
}
}
}
}
}
Using a different naming scheme
Alternatively, if the first option is not to your liking, you could use a different naming scheme for your files, and let the classes keep their old names.
Then you could use the fileSuffixToExtension provider like such:
{
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"root": true,
"dependentFileProviders": {
"add": {
"pathSegment": {
"add": {
".DefaultImplementation.cs": [
".cs"
]
}
}
}
}
}
This would map
IInvestigationRepository.DefaultImplementation.csto IInvestigationRepository.cs,
IReporterRepository.DefaultImplementation.csto IReporterRepository.cs
and so on.
This would also make the purpose of your files clearer, as just having the same name doesn't tell you what it's doing with the Interface, just that is has something to do with it.
If you don't want to use a notation with . and would prefer to use -, you can do that by replacing "pathSegment" with "fileSuffixToExtension", and replacing ".DefaultImplementation.cs" with "-DefaultImplementation.cs"