-
-
Notifications
You must be signed in to change notification settings - Fork 109
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 macro: single field for multiple snippets #43
Comments
You can actually provide as many snippets as you want if you use the Is this what you're looking for? |
Ha! Indeed! This issue can be closed if you don't think the drive micro should support this use case (but I'd be happy to know and learn why!) Anyway, thanks for your work! It works great :) |
I mean, I guess the derive macro could support this! I'll leave this issue open in case someone wants to contribute it, but I have no drive to do this myself. Maybe you can nerd snipe @cormacrelf into wanting to do it? ;) I'm thinking maybe something like a |
Ah yes, @, the nerd sniper's targeting reticle. Good shot. First off, I am pretty sure the lifetime on With that in mind, this is maybe a use case for my pet #41. If you can implement the Another option is adding an OwnedSnippet type to store in vectors, almost identical to DiagnosticSnippet except the source, which would be owned; then this all becomes very easy. It loses flexibility and I don't know who would miss that but the most plausible idea would be localisation of error messages, hints and such. Miette seems to be uniquely positioned for accessibility right now so I would want to keep that kind of thing open. I hope one day more compilers can have multilingual UIs. |
Also just noticed 2.0, nice work! You SEMVER BUMP miette? You interpret her MUST and MAY NOT as described in the RFC 2119? |
Was this attribute ever added to derive macro? I can't find it in the docs. |
An attribute was not added, no. |
Allowing dynamic list of spans to provide highlights you can be good for using miette to wrap tools like TypeScript (tsc).
Looking at the source code, maybe
Vec<SourceSpan>
might not cut it, but introducing a newLabelledSourceSpan
and allowing everything that isInto<Vec<LabelledSourceSpan>>
could also make sense.What do you think?
The text was updated successfully, but these errors were encountered: