-
Notifications
You must be signed in to change notification settings - Fork 8
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
Spork often prints fully qualified names even if the package is implicit in all source files #94
Comments
After some investigation, this appears to happen when only static members of a class are used. As soon as a non-static member is used, the package is marked implicit. Very strange. |
Ah, this actually seems to be worse. When only static methods are used on a class, and that class is not qualified (but imported), Spoon will somehow figure that this class is from the current package. Even if it's imported. |
I've devised a workaround for use in preprocessing: Provide the preprocessor with the active package as well as the list of imports. Then, each time a package reference is encountered, do this:
This seems to mostly solve the problem. It's a workaround, so ideally it can be removed once the problem is fixed in Spoon. |
This should be reverted once the bug is fixed in Spoon
I believe that this issue has been solved by INRIA/spoon#3364 and INRIA/spoon#3357 |
When Spoon has managed to resolve the package of a type, it often does not mark it as implicit. This causes absolutely massive diffs in files with many type references to classes that are imported, as they're often printed fully qualified by Spork.
This should be pretty easy to solve in printer preprocessing by simply marking any package that's imported as implicit.
The text was updated successfully, but these errors were encountered: