Skip to content

ProtocolMessage TypeScript declarations don't specify type field  #254

Open
@jesse-r-s-hines

Description

In the vscode-debugprotocol package, the type declarations for the ProtocolMessage subclasses, Request, Event, Response, etc. don't specify the type field. ProtocolMessage.type is defined as type: 'request' | 'response' | 'event' | string at the ProtocolMessage level. If the type enum was specified on each subclass as request, response, ect, then TypeScript can automatically cast a ProtocolMessage to the respective subclass when you check the type field, which would save boilerplate.

Similar type declarations could also be used on the Event.event field and Event's subclasses.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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