Skip to content

Conversation

Bashamega
Copy link
Contributor

#2053

This PR adds support for methods without explicit names.

I got the name "callable", from the jsonc

Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

// Keeping EventListener and EventListenerObject isn't the most elegant way to handle the event listeners, but we need to keep the EventListener as an extendable interface for libraries like angular.
interface EventListener noInterfaceObject=#true {
method callable {
type void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good reason to use returns=void

@@ -0,0 +1,7 @@
// Keeping EventListener and EventListenerObject isn't the most elegant way to handle the event listeners, but we need to keep the EventListener as an extendable interface for libraries like angular.
interface EventListener noInterfaceObject=#true {
method callable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have interface.anonymouseMethods so use it with something like anonymous-method {}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will update it

@Bashamega
Copy link
Contributor Author

I have updated @saschanaz
But anonymousMethods is not working, can you tell me what is wrong?

@saschanaz
Copy link
Contributor

Ohno, I forgot that it was only for getters and stringifiers... sorry 🫠

But maybe method "" works? "" is empty string in KDL.

@Bashamega Bashamega changed the title Support callable Support methods without names in interfaces Sep 27, 2025
@Bashamega
Copy link
Contributor Author

No issues @saschanaz
Is it now better?

];
return { name, signature };
return {
...optionalMember("name", "string", name),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should this be optionalMember?

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