Skip to content
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

refactor: fully specify options in the constructor of SniperPrettyPrinter #3197

Merged
merged 2 commits into from
Jan 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public SniperJavaPrettyPrinter(Environment env) {
mutableTokenWriter = new MutableTokenWriter(env);
//wrap that TokenWriter to listen on all incoming events and set wrapped version to DJPP
setPrinterTokenWriter(createTokenWriterListener(mutableTokenWriter));

// newly added elements are not fully qualified
this.setIgnoreImplicit(false);
}

/**
Expand Down Expand Up @@ -193,12 +196,11 @@ private static boolean hasImplicitAncestor(CtElement el) {
}

/**
* SniperPrettyPrinter does not apply preprocessor to a CtElement when calling toString()
* @param element
* @return
* Prints an element in sniper mode
*/
@Override
public String printElement(CtElement element) {
applyPreProcessors(element);
if (element != null && !hasImplicitAncestor(element)) {
CompilationUnit compilationUnit = element.getPosition().getCompilationUnit();
if (compilationUnit != null
Expand Down