Skip to content

Conversation

@as3boyan
Copy link
Contributor

@as3boyan as3boyan commented Apr 8, 2015

Preliminary test case for refactoring pull members up functionality
(not yet ready to pull, just to save this commit and solve issue with running tests)

@as3boyan
Copy link
Contributor Author

as3boyan commented Apr 8, 2015

Depends on #216

@as3boyan
Copy link
Contributor Author

Push Members Down: again some formatting issues when I try to do reformatting

  private void reformat(final PsiMember movedElement) {
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      @Override
      public void run() {
        final TextRange range = movedElement.getTextRange();
        final PsiFile file = movedElement.getContainingFile();

        PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(myProject);
        psiDocumentManager.doPostponedOperationsAndUnblockDocument(psiDocumentManager.getDocument(file));

        final PsiFile baseFile = file.getViewProvider().getPsi(file.getViewProvider().getBaseLanguage());
        CodeStyleManager.getInstance(myProject).reformatText(baseFile, range.getStartOffset(), range.getEndOffset());
      }
    });
  }

Same code works somehow for Pull Members Up.

…ationPart, then move parent (HaxeVarDeclaration)

 Fix Test Cases for Push Members Down #11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants