Skip to content

Disable lambda conversion in normal bindings#1928

Merged
tomasherceg merged 1 commit intomainfrom
disable-lambda-conversion
Jun 6, 2025
Merged

Disable lambda conversion in normal bindings#1928
tomasherceg merged 1 commit intomainfrom
disable-lambda-conversion

Conversation

@exyi
Copy link
Member

@exyi exyi commented Apr 26, 2025

In command bindings, expressions get automatically wrapped in a lambda function. Surprisingly, the behavior was also present in value/resource, which lead to some surprising effects when value/resource was accidentally assigned to a command property (#1742).

We also unify that untyped ICommandBinding and IStaticCommandBinding produce delegate of type Command (i.e. async function with no argument and no return value). Previously Delegate was used for commands,
which had the effect of sending the return value to the client

@exyi exyi requested a review from Copilot April 26, 2025 13:37

This comment was marked as resolved.

In command bindings, expressions get automatically wrapped in a lambda function. Surprisingly, the
behavior was also present in value/resource, which lead
to some surprising effects when value/resource was
accidentally assigned to a command property (#1742).

We also unify that untyped ICommandBinding and IStaticCommandBinding
produce delegate of type Command (i.e. async function with no argument and no return value).
Previously Delegate was used for commands,
which had the effect of sending the return value to the client
@exyi exyi force-pushed the disable-lambda-conversion branch from 3cd3081 to 3c2249d Compare June 1, 2025 09:25
@tomasherceg tomasherceg merged commit ba0372c into main Jun 6, 2025
14 of 16 checks passed
@tomasherceg tomasherceg deleted the disable-lambda-conversion branch June 6, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants