Skip to content

getInfoContribution is not composable  #221

@charlespwd

Description

@charlespwd

I'm struggling a little with the JSONWorkerContribution interface to provide smart hover.

From what I can read in jsonHover, it looks like a JSONWorkerContribution.getInfoContribution should return undefined when there's nothing to show (which prevents the use of async function() since it would return Promise).

I'm struggling with two things with this API design:

  1. getInfoContribution(uri, location) does not let me discriminate on if the location is to a property or value node
  2. If getInfoContribution(uri, location) returns something, hover info from the schema is not shown (it's one or the other)

I kind of would like to be able to show both if both have something.

For instance, at Shopify we have those large translation files. It feels like it would make sense to have a getInfoContribution that prints out the translation key of the thing under the cursor ('deep.path.to.key'), but this should only happen on the key and if there's something special from the schema, then I'd probably want that as well.

e.g. keys that end in _html have a special meaning and there's docs associated with them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions