-
Notifications
You must be signed in to change notification settings - Fork 12
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
Is it possible to add docstring to a field? #17
Comments
why do you think so? you can't document fields in Julia. |
I read about it in the Julia documentation (https://docs.julialang.org/en/v1/manual/documentation/#Types)? |
Hmm interesting I think somehow the lowered Expr is not the same as function docstring. There's no way to remove this feature unless you define your own macro using the codegen feature in advanced usage at the moment But yes I need to come up with a better syntax for aliasing |
so it seems the field docstring is created by struct TT
"x"
x::Int
"y"
y::Real
end |
I gave codegen a try yesterday but didn't get very far since I haven't done much metaprogramming in Julia before. I tried to remove
Maybe something similar to what FieldMetadata.jl is using?
Yes, I realised this when making the mwe, which is a little strange indeed. Good that you've opened an issue on that. thanks:) |
you need to remove https://rogerluo.me/Configurations.jl/dev/advance/#Configurations.codegen_field_alias not |
I tried it when I designing the syntax, it creates an ugly AST when combined with keywords. I might be using docstrings like Comonicon's |
field alias feature is removed temporarily for the latest version. |
I implemented the logic to extract field docstrings here: https://github.com/JuliaPluto/PlutoSliderServer.jl/blob/29d9f5b03509036c938e199e7d6f8863a126f53b/src/ConfigurationDocs.jl#L126 though this was more with the intention of generating a list of keyword arguments automatically, not the Julia-official |
It seems that we won't be able to add docstring to a field, possibly due to the
alias
functionality?If I don't use
alias
, is there a way to document fields like what was describe in the language documentation?The text was updated successfully, but these errors were encountered: