Screenshots with configuration for addedExtension/pathSegment show no extensions added at all. Is it meant to be that way? If yes, does it imply "*" and can only specific extension be specified?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
settings in screenshots in the article you mentioned show default settings for core web projects. No settings in addedExtension, for example, means that there no any rules specified for that section and no files will be nested using that rule. No settings means no action. Hope that helped.
Not really. In fact, now I'm confused even more. Descriptions for the screenshots read as following:
file.html.css is nested under file.html because of the addedExtension rule
jquery.min.js is nested under jquery.js because of the pathSegment rule
Your explanation:
No settings in addedExtension, for example, means that there no any rules specified for that section and no files will be nested using that rule. No settings means no action.
According to you, no files should be nested as a result of the section. However, the descriptions explicitly tell that there are nested files. Usually, if there is an example of a code/configuration snippet, its description describes what that snippet actually does. In this case, the description describes some action, but the snippet implies "there is no action".
I hope that clears the reasons behind my confusion.
You are right. I replied too soon and miss-understood the section you are asking about.
addedExtension is an exception from other rules when it naturally can be applied to all files. As you saw in the article's example file.html.css nested under file.html, meaning any files are matched by any added extension, in this case .css is added extension and file.html is the base. Since this rule can be applied to all file extensions (any extension can be added), it is not needed to specify any options in that provider section.
All other providers need some settings specified, as I mentioned earlier.
addedExtension is an exception from other rules
What about pathSegment?
pathSegment also does not need any parameters because of the nature of the rule, similar to addedExtensions. What exactly is confusing you in those two rules? All rules in that file don't have to have anything in common, they are implemented by different providers and can have absolutely different schema underneath their sections if they wanted to. We just tried to have as common as possible schema for them however, anyone can implement a custom nesting provider with their own rules and schema. When I said exception, I meant that addedException's logic already implied and does not need parameters, same is for pathSegment.
Makes sense, thanks @abpiskunov. One last question: is there a way to limit the effect of addedExtensions/pathSegment to only select file extensions?
For pathSegment, yes you can specify explicitly settings (add/remove):
"pathSegment": {
"add": {
".*": [
".js",
".css",
".html",
".htm",
".less",
".scss",
".coffee",
".iced",
".config",
".cs",
".vb",
".json"
]
}
},
for addedExtension - no.
Thanks for the clarification. Do you reckon it's worth mentioning in the documentation?
It probably is, I will ping our PM.
Most helpful comment
Not really. In fact, now I'm confused even more. Descriptions for the screenshots read as following:
Your explanation:
According to you, no files should be nested as a result of the section. However, the descriptions explicitly tell that there are nested files. Usually, if there is an example of a code/configuration snippet, its description describes what that snippet actually does. In this case, the description describes some action, but the snippet implies "there is no action".
I hope that clears the reasons behind my confusion.