-
Notifications
You must be signed in to change notification settings - Fork 10
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
derive: some clean-ups and optimizations #260
base: master
Are you sure you want to change the base?
Conversation
d3e63b3
to
a4e6f66
Compare
Some((ident, PartialTemplateArgsSource::InDoc(_))) => { | ||
source_from_docs(&ident, &args.meta_docs, ast)? | ||
Some(PartialTemplateArgsSource::InDoc(s)) => { | ||
source_from_docs(s.span(), &args.meta_docs, ast)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!
@@ -7,10 +7,10 @@ error: unknown node `fail` | |||
| ^^^^^^^^^^^^^^^^^^^^^^ | |||
|
|||
error: when using `in_doc = true`, the struct's documentation needs a `rinja` code block | |||
--> tests/ui/rinja-block.rs:15:25 | |||
--> tests/ui/rinja-block.rs:15:34 | |||
| | |||
15 | #[template(ext = "txt", in_doc = true)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it underline the whole in_doc = true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the other cases we also only underline the value part, the part after the equals sign. I actually came to like that, because the problem is with the value, not with the key. If you write in_doc = false
, then everything is fine (except that in here there is not source).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmmmmm. Then the message needs to be reworded a bit to make it obvious that the value is the value. Like:
when using
in_doc
with thetrue
value, the struct's documentation needs arinja
code block
Or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the message a bit. Do you think it's more clear now?
Apart from my one comment, looks all good to me, thanks! Please feel free to merge even without fixing my comment (but if you do, please open an issue so we don't forget about it and I'd love to fix it 😄 ). |
a4e6f66
to
b291e1a
Compare
Minor changes extracted from the
enum
implementation. Please see the individual commits.