Skip to content

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

Closed
@mjbvz

Description

@mjbvz

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

Metadata

Metadata

Assignees

Labels

APIRelates to the public API for TypeScriptIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions