-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Scaladoc - fix uncompiling snippets, fix indentation for snippets #14856
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
Conversation
da37458
to
8057f8d
Compare
9345810
to
f8969ae
Compare
Basically, we started with idea to add Removing this feature solved the problem with macros as well as with running snippets in API docs. It was also based on some nasty piece of code that we couldn't prove it actually works. |
As it affects snippets in stdlib documentation, I'll ask @nicolasstucki if he's fine with that. |
It seems that most of the changes are just adding a wildcard import from the current package. Can we maybe add it as default to the generated code? |
Main change of this PR is fixing existing snippets and adding new flag for macro snippets to fix it's creation.
The repair of it was due, mainly for #10896 ( this issue, may or may not be closed after this PR, as it's unresolved )
First one is
sc:macrocompile
which allows to parse macros as snippets. Before this changes, snippets were wrapped in traits which are not static what lead to macro malformation. This flag skips wrapping in Traits with self types in favour of singleobject Snippet { ... }
wrapping to enable snippet validation at compile time.https://dotty.epfl.ch/api/scala/quoted/Varargs$.html#
Before:

After ( + it now checks snippet at compiletime ):
