Package de.halirutan.mathematica.parsing.psi.util

Examples of de.halirutan.mathematica.parsing.psi.util.MathematicaPsiElementFactory


  }

  @Nullable
  @Override
  public TextRange surroundElements(@NotNull final Project project, @NotNull final Editor editor, final Expression element) throws IncorrectOperationException {
    MathematicaPsiElementFactory factory = new MathematicaPsiElementFactory(project);
    CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project);

    Expression parExpr = factory.createExpressionFromText(myOpener + element.getText() + myCloser);
    parExpr = (Expression) codeStyleManager.reformat(parExpr);
    final PsiElement replace = element.replace(parExpr);
    return TextRange.from(replace.getTextOffset() + replace.getTextLength(), 0);
  }
View Full Code Here


  public PsiElement getDocumentationElementForLookupItem(PsiManager psiManager, Object object, PsiElement element) {
    if (element != null) {
      final LookupEx activeLookup = LookupManager.getActiveLookup(FileEditorManager.getInstance(element.getProject()).getSelectedTextEditor());
      if (activeLookup != null) {
        if (activeLookup.isFocused()) {
          MathematicaPsiElementFactory elementFactory = new MathematicaPsiElementFactory(psiManager.getProject());
          try {
            return elementFactory.createSymbol(object.toString());
          } catch (Exception e) {
            return null;
          }
        }
      }
View Full Code Here

TOP

Related Classes of de.halirutan.mathematica.parsing.psi.util.MathematicaPsiElementFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.