Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getInfoContribution is not composable #221

Open
charlespwd opened this issue Feb 20, 2024 · 1 comment · May be fixed by #222
Open

getInfoContribution is not composable #221

charlespwd opened this issue Feb 20, 2024 · 1 comment · May be fixed by #222

Comments

@charlespwd
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant