Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo Owning Type Arguments #714

Merged
merged 8 commits into from
Oct 29, 2024

Conversation

ambiguousname
Copy link
Member

Adds FunctionOwningType:ParameterType as a default way of labeling parameters.

Fixes #713, intended to fix #611 as well.

Copy link
Collaborator

@robertbastian robertbastian left a comment

Choose a reason for hiding this comment

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

I realise this wasn't clear the way I filed the issue, but I was thinking of using the parameter names, not the types. The reason is that there can be two parameters of the same type, but they would have different names.

@Manishearth
Copy link
Contributor

We'd maybe even want to do both

This is why I'd love for this information to be passed down to the renderer in a structured fashion: My ideal UI for this is something like this with <fieldset>

image

@ambiguousname
Copy link
Member Author

I think that'd be fantastic! Fixes for using parameter names are in.

I'll open an issue for adding more context in RenderInfo (and updating the default renderer to use <fieldset>)

@ambiguousname
Copy link
Member Author

Just one note, if the parameter is the self parameter, the default labeling will show up as something like Self:ParamName. Is that desirable? It might be less ambiguous to replace self with the owning type of the function.

@robertbastian
Copy link
Collaborator

I think self if fine for now.

@robertbastian robertbastian merged commit b49d63e into rust-diplomat:main Oct 29, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-demo_gen Demo_Gen backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use multi-level argument names in demo_gen Demo_Gen: Parameter Naming Conventions
3 participants