eclipse / lsp4mp

Technology lsp4mp
Eclipse Public License 2.0
22 stars 29 forks source link

Support MicroProfile 4.0 APIs #99

Open yeekangc opened 4 years ago

yeekangc commented 4 years ago

This is an "epic" to identify and track the work that is needed to support MP 4.0 APIs when the release reaches GA

angelozerr commented 4 years ago

If we should support deprecated property inside microprofile-config.properties, we could do that like Spring Boot Metadata https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-configuration-metadata.html#configuration-metadata-property-attributes provides with deprecation information.

We could implement it if we need to support deprecated properties.

rzgry commented 4 years ago

@angelozerr Along with any deprecated properties. It would be nice to provide some kind of support for newly added properties. For example: MP Health 3.0 will add a new mp.health.default.readiness.empty.response property. (https://github.com/eclipse/microprofile-health/releases)

Would be good to only display the property for mp.health.default.readiness.empty.response if they are using MP health >= 3.0.

angelozerr commented 4 years ago

Would be good to only display the property for mp.health.default.readiness.empty.response if they are using MP health >= 3.0.

Ok I see the idea. The problem comes from only with static-properties (our static JSON files which describe properties). An idea that I had, is that we could add a new attribute @sinceto declare when the property is available.

For instance in https://github.com/eclipse/lsp4mp/blob/master/microprofile.jdt/org.eclipse.lsp4mp.jdt.core/static-properties/mp-health-metadata.json

we could write the property mp.health.default.readiness.empty.response like this:

{
     ...
      "name": "mp.health.default.readiness.empty.response",
      "@since": 3.0
}

and in https://github.com/eclipse/lsp4mp/blob/ab86a54e2be98c20ada1664ce910a015779c6b4d/microprofile.jdt/org.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/jdt/internal/health/properties/MicroProfileHealthProvider.java#L34

The AbstractStaticPropertiesProvider will load the JSON file and loop for each ItemMetadata and when it found @since, it will call a new method boolean checkVersion(SearchContext context, IProgressMonitor monitor) to check if the property must be collected or not.

We could imagine too to have a settings which returns even the mp.health.default.readiness.empty.response and on MP LS side we could provide a code action which says "Install MP 3.0")

For deprecated property, we could add a new property @upon and mark the property as deprecated.