diff --git a/doc/overview/dynamicCapabilities.md b/doc/overview/dynamicCapabilities.md index df4e948..a9e7f7f 100644 --- a/doc/overview/dynamicCapabilities.md +++ b/doc/overview/dynamicCapabilities.md @@ -53,6 +53,26 @@ public MyComponent(ConfiguredProject configuredProject) The `DeployProviders` collection will contain a set of `IDeployProvider` filtered by the current capabilities of the configuredProject. The content of the collection can change over the time. +## Defining fixed capabilities for a project type + +Some capabilities are static/fixed for a given project type. These capabilities should be defined directly on the +project type registration. + +For example: + +```c# +[assembly: ProjectTypeRegistration( + projectTypeGuid: MyProjectType.Guid, + displayName: "#1", + displayProjectFileExtensions: "#2", + defaultProjectExtension: "myproj", + language: "MyLang", + resourcePackageGuid: MyPackage.PackageGuid, + Capabilities = "MyProject")] +``` + +Capabilities defined via the `ProjectTypeRegistrationAttribute.Capabilities` property are available on all projects loaded for that project type. + ## Dynamically producing project capabilities Capabilities can be added to a project at run-time via code. To do so, export an instance of @@ -82,6 +102,8 @@ internal class TuesdayProjectCapabilityProvider : ProjectCapabilitiesProviderBas } ``` +Note there can be a chicken/egg problem here, where one capability enables a provider (via `AppliesTo`) that then adds another capability, and so on. + ## How to prevent seeing capability changes in the middle of an execution When changes are made to the project, just like other dataflows inside CPS, capabilites are being recalculated