TS Server: Add way for plugins to provided additional metadata in responses · Issue #21999 · microsoft/TypeScript (original) (raw)
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