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

TS Server: Add way for plugins to provided additional metadata in responses #21999

Closed
mjbvz opened this issue Feb 16, 2018 · 0 comments
Closed
Assignees
Labels
API Relates to the public API for TypeScript In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Feb 16, 2018

Problem
TS Server plugins sometimes want to provide additional metadata on responses beyond that found in the official TS Server API. Two examples:

  • Emmet needs to pass a special isIncomplete property to VS Code. This property tells VS Code to re-trigger completions when ever the user types - Emmet in typescript styled plugin typescript-styled-plugin#33 (comment)

  • The styled plugin would like to pass color metadata information for color completions so that a preview of these colors are shown in the suggestion UI

Right now, I believe the TS server strips all unrecognized properties from response objects

Proposed fix
Either:

  • Make the TS server serialize all properties on response objects, recognized or not.

  • Add a special metadata property to responses that a plugin can use to pass additional information along.

/cc @ramya-rao-a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Relates to the public API for TypeScript In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

5 participants