Skip to content

Commit

Permalink
drive function with includeFilePattern argument
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136686971
  • Loading branch information
linarm authored and blickly committed Oct 20, 2016
1 parent 2a79d7c commit 04fd21f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/com/google/javascript/refactoring/RefactoringDriver.java
Expand Up @@ -33,6 +33,7 @@
import com.google.javascript.rhino.Node;

import java.util.List;
import java.util.regex.Pattern;

/**
* Primary driver of a refactoring. This class collects the inputs, runs the refactoring over
Expand All @@ -59,14 +60,21 @@ private RefactoringDriver(
/**
* Run the refactoring and return any suggested fixes as a result.
*/
public List<SuggestedFix> drive() {
JsFlumeCallback callback = new JsFlumeCallback(scanner, null);
public List<SuggestedFix> drive(Pattern includeFilePattern) {
JsFlumeCallback callback = new JsFlumeCallback(scanner, includeFilePattern);
NodeTraversal.traverseEs6(compiler, rootNode, callback);
List<SuggestedFix> fixes = callback.getFixes();
fixes.addAll(scanner.processAllMatches(callback.getMatches()));
return fixes;
}

/**
* Run the refactoring and return any suggested fixes as a result.
*/
public List<SuggestedFix> drive() {
return drive(null);
}

public Compiler getCompiler() {
return compiler;
}
Expand Down

0 comments on commit 04fd21f

Please sign in to comment.