You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently model inheritance using #[serde(flatten)] like below:
#[derive(Debug,PartialEq,Clone,Deserialize,Serialize)]#[serde(rename_all = "camelCase")]pubstructCompletionParams{// This field was "mixed-in" from TextDocumentPositionParams#[serde(flatten)]pubtext_document_position:TextDocumentPositionParams,#[serde(flatten)]pubwork_done_progress_params:WorkDoneProgressParams,#[serde(flatten)]pubpartial_result_params:PartialResultParams,// CompletionParams properties:#[serde(skip_serializing_if = "Option::is_none")]pubcontext:Option<CompletionContext>,}
The above corresponds to the following typescript
exportinterfaceCompletionParamsextendsTextDocumentPositionParams,WorkDoneProgressParams,PartialResultParams{/** * The completion context. This is only available it the client specifies * to send this using the client capability `textDocument.completion.contextSupport === true` */context?: CompletionContext;}
This becomes difficult to maintain when a concept like partial results or progress are added to the protocol (which changes server and client caps, params and result types). Maybe we should investigate a macro (or custom derive?) approach to make this sort of thing easier and less error prone.
The text was updated successfully, but these errors were encountered:
We currently model inheritance using
#[serde(flatten)]
like below:The above corresponds to the following typescript
This becomes difficult to maintain when a concept like partial results or progress are added to the protocol (which changes server and client caps, params and result types). Maybe we should investigate a macro (or custom derive?) approach to make this sort of thing easier and less error prone.
The text was updated successfully, but these errors were encountered: