use of org.elixir_lang.psi.call.Named in project intellij-elixir by KronicDeth.
the class Variants method addToLookupElementByPsiElement.
/*
* Private Instance Methods
*/
private void addToLookupElementByPsiElement(@NotNull Call call) {
if (call instanceof Named) {
Named named = (Named) call;
PsiElement nameIdentifier = named.getNameIdentifier();
if (nameIdentifier != null) {
if (lookupElementByPsiElement == null || !lookupElementByPsiElement.containsKey(nameIdentifier)) {
if (lookupElementByPsiElement == null) {
lookupElementByPsiElement = new THashMap<PsiElement, LookupElement>();
}
String name = nameIdentifier.getText();
lookupElementByPsiElement.put(nameIdentifier, LookupElementBuilder.createWithSmartPointer(name, nameIdentifier).withRenderer(new org.elixir_lang.code_insight.lookup.element_renderer.CallDefinitionClause(name)));
}
}
}
}
use of org.elixir_lang.psi.call.Named in project intellij-elixir by KronicDeth.
the class MultiResolve method addToResolveResultList.
/*
* Private Instance Methods
*/
/*
* Private Instance Methods
*/
private boolean addToResolveResultList(@NotNull Call call, boolean validResult, ResolveState state) {
boolean keepProcessing = true;
if (call instanceof Named) {
Named named = (Named) call;
PsiElement nameIdentifier = named.getNameIdentifier();
if (nameIdentifier != null) {
if (PsiTreeUtil.isAncestor(state.get(ENTRANCE), nameIdentifier, false)) {
addNewToResolveResultList(nameIdentifier, validResult);
keepProcessing = false;
} else {
/* Doesn't use a Map<PsiElement, ResolveSet> so that MultiResolve's helpers that require a
List<ResolveResult> can still work */
addNewToResolveResultList(nameIdentifier, validResult);
Call importCall = state.get(IMPORT_CALL);
if (importCall != null) {
addNewToResolveResultList(importCall, validResult);
}
}
}
}
return keepProcessing;
}
use of org.elixir_lang.psi.call.Named in project intellij-elixir by KronicDeth.
the class Callable method calculateDefaultRangeInElement.
/*
* Protected Instance Methods
*/
@Override
protected TextRange calculateDefaultRangeInElement() {
TextRange defaultRangeInElement = null;
TextRange myElementRangeInDocument = myElement.getTextRange();
int myElementStartOffset = myElementRangeInDocument.getStartOffset();
if (myElement instanceof Named) {
Named named = (Named) myElement;
PsiElement nameIdentifier = named.getNameIdentifier();
if (nameIdentifier != null) {
TextRange nameIdentifierRangeInDocument = nameIdentifier.getTextRange();
defaultRangeInElement = new TextRange(nameIdentifierRangeInDocument.getStartOffset() - myElementStartOffset, nameIdentifierRangeInDocument.getEndOffset() - myElementStartOffset);
}
}
if (defaultRangeInElement == null) {
defaultRangeInElement = new TextRange(0, myElementRangeInDocument.getEndOffset() - myElementStartOffset);
}
return defaultRangeInElement;
}
Aggregations