Ejemplo n.º 1
0
 @Override
 public PsiElement resolve() {
   PsiElement _xblockexpression = null;
   {
     ProgressIndicatorProvider.checkCanceled();
     ICrossReferenceDescription crossReferenceDescription = this.getCrossReferenceDescription();
     boolean _equals = Objects.equal(crossReferenceDescription, null);
     if (_equals) {
       return null;
     }
     EObject object = crossReferenceDescription.resolve();
     ProgressIndicatorProvider.checkCanceled();
     _xblockexpression = this.psiModelAssociations.getPsiElement(object);
   }
   return _xblockexpression;
 }
Ejemplo n.º 2
0
 @Override
 public Object[] getVariants() {
   ArrayList<LookupElementBuilder> _xblockexpression = null;
   {
     ProgressIndicatorProvider.checkCanceled();
     ICrossReferenceDescription crossReferenceDescription = this.getCrossReferenceDescription();
     boolean _equals = Objects.equal(crossReferenceDescription, null);
     if (_equals) {
       return ((Object[])
           Conversions.unwrapArray(CollectionLiterals.<Object>emptyList(), Object.class));
     }
     ArrayList<LookupElementBuilder> variants =
         CollectionLiterals.<LookupElementBuilder>newArrayList();
     Iterable<IEObjectDescription> _variants = crossReferenceDescription.getVariants();
     for (final IEObjectDescription objectDescription : _variants) {
       {
         ProgressIndicatorProvider.checkCanceled();
         QualifiedName _name = objectDescription.getName();
         String name = this.qualifiedNameConverter.toString(_name);
         BaseXtextFile _xtextFile = this.myElement.getXtextFile();
         XtextResource _resource = _xtextFile.getResource();
         PsiElement element =
             this.psiModelAssociations.getPsiElement(objectDescription, _resource);
         boolean _notEquals = (!Objects.equal(element, null));
         if (_notEquals) {
           LookupElementBuilder _create = LookupElementBuilder.create(name);
           PsiElement _navigationElement = element.getNavigationElement();
           PsiFile _containingFile = _navigationElement.getContainingFile();
           String _name_1 = _containingFile.getName();
           LookupElementBuilder _withTypeText = _create.withTypeText(_name_1);
           variants.add(_withTypeText);
         }
       }
     }
     _xblockexpression = variants;
   }
   return ((Object[]) Conversions.unwrapArray(_xblockexpression, Object.class));
 }
Ejemplo n.º 3
0
 @Override
 public TextRange getRangeToHighlightInElement() {
   final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList();
   final TextRange _result;
   synchronized (_createCache_getRangeToHighlightInElement) {
     if (_createCache_getRangeToHighlightInElement.containsKey(_cacheKey)) {
       return _createCache_getRangeToHighlightInElement.get(_cacheKey);
     }
     TextRange _xblockexpression = null;
     {
       ICrossReferenceDescription _crossReferenceDescription = this.getCrossReferenceDescription();
       final ITextRegion textRegion = _crossReferenceDescription.getTextRegion();
       int _offset = textRegion.getOffset();
       TextRange _textRange = this.myElement.getTextRange();
       int _startOffset = _textRange.getStartOffset();
       int startOffset = (_offset - _startOffset);
       TextRange _xifexpression = null;
       if ((startOffset < 0)) {
         _xifexpression = this.getRangeInElement();
       } else {
         TextRange _xblockexpression_1 = null;
         {
           int _length = textRegion.getLength();
           final int endOffset = (startOffset + _length);
           _xblockexpression_1 = new TextRange(startOffset, endOffset);
         }
         _xifexpression = _xblockexpression_1;
       }
       _xblockexpression = _xifexpression;
     }
     _result = _xblockexpression;
     _createCache_getRangeToHighlightInElement.put(_cacheKey, _result);
   }
   _init_getRangeToHighlightInElement(_result);
   return _result;
 }