Open rbuckton opened 3 years ago
I agree with the pain-point. IMHO the pain is even greater than having a lot of objects in the contributes
section. Other very annoying aspects of authoring package.json
:
package.nls.json
and %
strings must be manually created with identifiers, making it very difficult to remember which id was which command (what the title was, etc.)package.json
and then changes only the name
.
For any large extension the size of the
"contributes"
entry inpackage.json
can also grow to be extremely large and difficult to maintain, especially since you cannot organize contributions by feature or add comments (sincepackage.json
must be pure JSON).I would propose adding something like the following to
"contributes"
to allow for composition of extension contributions from one or more external files:Where
"feature1.json"
might be:The proposed order of composition would be:
"include"
are applied in array order.package.json
are applied last.In the event of a collision where two contribution sources define the same contribution (such as two commands with the same name), I see at least two options:
vsce
could provide errors or warnings for collisions prior to packing/publishing.I'm generally in favor of "last in wins" so as not to hamper local development/testing while refactoring an extension, but don't have a strong preference either way.
One caveat to this approach is that there would need to be some way for VS Code to know that
feature1.json
is an external contribution manifest. This could possibly be accomplished by using a well-defined filename format such as<name>-contributions.json
(similar tolanguage-configuration.json
), or by using a"$schema"
entry on the top-level object.