Search in sources :

Example 1 with Differ

use of com.intellij.psi.codeStyle.extractor.differ.Differ in project intellij-community by JetBrains.

the class BruteForceProcessor method runWithProgress.

@Override
public ValuesExtractionResult runWithProgress(Project project, CodeStyleSettings settings, PsiFile file, ProgressIndicator indicator) {
    List<Value> values = getFormattingValues(settings, file.getLanguage());
    Differ differ = myLangExtractor.getDiffer(project, file, settings);
    ValuesExtractionResult container = new ValuesExtractionResultImpl(values);
    Utils.adjustValuesMin(container, differ, indicator);
    return container;
}
Also used : ValuesExtractionResultImpl(com.intellij.psi.codeStyle.extractor.values.ValuesExtractionResultImpl) Differ(com.intellij.psi.codeStyle.extractor.differ.Differ) ValuesExtractionResult(com.intellij.psi.codeStyle.extractor.values.ValuesExtractionResult) Value(com.intellij.psi.codeStyle.extractor.values.Value)

Example 2 with Differ

use of com.intellij.psi.codeStyle.extractor.differ.Differ in project intellij-community by JetBrains.

the class GenProcessor method runWithProgress.

@Override
public Gens runWithProgress(Project project, CodeStyleSettings settings, PsiFile file, ProgressIndicator indicator) {
    final Gens origGens = new Gens(getFormattingValues(settings, file.getLanguage()));
    final Gens forSelection = origGens.copy();
    final Differ differ = myLangExtractor.getDiffer(project, file, settings);
    forSelection.dropToInitial();
    Utils.resetRandom();
    long startTime = System.nanoTime();
    Utils.adjustValuesGA(forSelection, differ, indicator);
    reportResult("GA", forSelection, differ, startTime, file.getName());
    startTime = System.nanoTime();
    Utils.adjustValuesMin(forSelection, differ, indicator);
    reportResult("MIN", forSelection, differ, startTime, file.getName());
    return forSelection;
}
Also used : Gens(com.intellij.psi.codeStyle.extractor.values.Gens) Differ(com.intellij.psi.codeStyle.extractor.differ.Differ)

Aggregations

Differ (com.intellij.psi.codeStyle.extractor.differ.Differ)2 Gens (com.intellij.psi.codeStyle.extractor.values.Gens)1 Value (com.intellij.psi.codeStyle.extractor.values.Value)1 ValuesExtractionResult (com.intellij.psi.codeStyle.extractor.values.ValuesExtractionResult)1 ValuesExtractionResultImpl (com.intellij.psi.codeStyle.extractor.values.ValuesExtractionResultImpl)1