Package de.halirutan.mathematica.parsing.psi.impl

Examples of de.halirutan.mathematica.parsing.psi.impl.SymbolImpl


    // containing the lookup name back.
    final LookupEx activeLookup = LookupManager.getActiveLookup(editor);
    if ((activeLookup != null) && activeLookup.isFocused()) {
      final PsiElement elementAt = file.findElementAt(editor.getCaretModel().getOffset() - 1);
      if (elementAt != null) {
        Symbol lookup = new SymbolImpl(elementAt.getNode());
        final LookupElement currentItem = activeLookup.getCurrentItem();
        final String lookupString = currentItem != null ? currentItem.getLookupString() : "";
        lookup.setName(lookupString);
        return lookup;
      }
    }

    if (contextElement != null) {
      PsiElement parent = contextElement.getParent();

      if ((contextElement instanceof PsiWhiteSpace) || !((parent instanceof Symbol) || (parent instanceof OperatorNameProvider))) {
        PsiElement elm = file.findElementAt(editor.getCaretModel().getOffset() - 1);
        if (elm != null) {
          contextElement = elm;
          parent = elm.getParent();
        }
      }

      if (parent instanceof Symbol) {
        return new SymbolImpl(parent.getNode());
      }

      // Determine if the contextElement is the operator sign of an operation.
      // See the doc to OperatorNameProviderImpl.
      if (parent instanceof OperatorNameProvider) {
View Full Code Here

TOP

Related Classes of de.halirutan.mathematica.parsing.psi.impl.SymbolImpl

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.