Search in sources :

Example 1 with BuckVisitor

use of com.facebook.buck.intellij.ideabuck.lang.psi.BuckVisitor in project buck by facebook.

the class DependenciesOptimizer method optimzeDeps.

public static void optimzeDeps(@NotNull PsiFile file) {
    final PropertyVisitor visitor = new PropertyVisitor();
    file.accept(new BuckVisitor() {

        @Override
        public void visitElement(PsiElement node) {
            node.acceptChildren(this);
            node.accept(visitor);
        }
    });
    // Commit modifications.
    final PsiDocumentManager manager = PsiDocumentManager.getInstance(file.getProject());
    manager.doPostponedOperationsAndUnblockDocument(manager.getDocument(file));
}
Also used : BuckVisitor(com.facebook.buck.intellij.ideabuck.lang.psi.BuckVisitor) PsiElement(com.intellij.psi.PsiElement) PsiDocumentManager(com.intellij.psi.PsiDocumentManager)

Aggregations

BuckVisitor (com.facebook.buck.intellij.ideabuck.lang.psi.BuckVisitor)1 PsiDocumentManager (com.intellij.psi.PsiDocumentManager)1 PsiElement (com.intellij.psi.PsiElement)1