-
Notifications
You must be signed in to change notification settings - Fork 873
Closed
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunities
Milestone
Description
It would be very handy if parts of the specification could be read by machines.
This would help developing SDKs for typed languages a lot, as many types can be auto generated.
Besides, there are some inconsistencies in non-normative parts of the specification that could be easily fixed (e.g. interfaces vs exported interfaces, params
vs param
).
Something like this would be awesome in addition to the existing specification:
(comments removed to keep it short)
interface RequestMessage<TMethod extends string, TParams> {
id: number | string;
method: TMethod;
params: TParams
}
interface ResponseMessage<TResult, TError> {
id: number | string;
result?: TResult;
error?: ResponseError<TError>;
}
interface Request<TRequest, TResponse> {}
interface Notification<TRequest> {}
// ...
type InitializeRequest = Request<
RequestMessage<"initialize", InitializeParams>,
ResponseMessage<InitializeResult, InitializeError>
>;
type ShutdownRequest = Request<
RequestMessage<"shutdown", undefined>,
ResponseMessage<undefined, undefined>
>;
type ShowMessageNotification = Notification<
RequestMessage<"window/showMessage", ShowMessageParams>
>;
What do you think? I can offer to add these additional typescript definitions for all of the about 30 notifications / requests.
DanTup, axelson, KamasamaK, radeksimko, h-michael and 15 more
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunities