// Path: src/org/emberjs/codeInsight/ComponentUtil.java
// public class ComponentUtil {
//     public static String getAttributeName(final String text) {
//         final String[] split = StringUtil.unquoteString(text).split("(?=[A-Z])");
//         for (int i = 0; i < split.length; i++) {
//             split[i] = StringUtil.decapitalize(split[i]);
//         }
//         return StringUtil.join(split, "-");
//     }
// 
//     public static String attributeToComponent(String name) {
//         final String[] words = name.split("-");
//         for (int i = 1; i < words.length; i++) {
//             words[i] = StringUtil.capitalize(words[i]);
//         }
//         return StringUtil.join(words);
//     }
// 
//     public static boolean processComponents(final Project project,
//                                                Processor<JSNamedElementProxy> processor) {
//         final Collection<String> docComponents = EmberIndexUtil.getAllKeys(EmberComponentDocIndex.INDEX_ID, project);
//         for (String componentName : docComponents) {
//             final JSNamedElementProxy component = getComponentProxy(project, componentName, EmberComponentDocIndex.INDEX_ID);
//             if (component != null) {
//                 if (!processor.process(component)) {
//                     return false;
//                 }
//             }
//         }
//         final Collection<String> components = EmberIndexUtil.getAllKeys(EmberComponentIndex.INDEX_ID, project);
//         for (String componentName : components) {
//             if (!docComponents.contains(componentName)) {
//                 final JSNamedElementProxy component = getComponentProxy(project, componentName, EmberComponentIndex.INDEX_ID);
//                 if (component != null) {
//                     if (!processor.process(component)) {
//                         return false;
//                     }
//                 }
//             }
//         }
//         return true;
//     }
// 
//     public static JSNamedElementProxy getComponentProxy(String componentName, Project project) {
//         final JSNamedElementProxy component = getComponentProxy(project, componentName, EmberComponentDocIndex.INDEX_ID);
//         return component == null ? getComponentProxy(project, componentName, EmberComponentIndex.INDEX_ID) : component;
//     }
// 
//     private static JSNamedElementProxy getComponentProxy(Project project, String componentName, final ID<String, Void> index) {
//         final JSNamedElementProxy component = EmberIndexUtil.resolve(project, index, componentName);
//         // TODO: do some stuff??
//         return null;
//     }
// 
//     @Nullable
//     public static JSNamedElementProxy getComponent(@Nullable PsiElement element) {
//         if (element instanceof JSNamedElementProxy) {
//             return getComponent(element, ((JSNamedElementProxy)element).getName());
//         }
//         if (element instanceof JSLiteralExpression && ((JSLiteralExpression)element).isQuotedLiteral()) {
//             return getComponent(element, StringUtil.unquoteString(element.getText()));
//         }
//         return null;
//     }
// 
//     private static JSNamedElementProxy getComponent(PsiElement element, final String name) {
//         final String componentName = getAttributeName(name);
//         final JSNamedElementProxy component = EmberIndexUtil.resolve(element.getProject(), EmberComponentIndex.INDEX_ID, componentName);
//         if (component != null && element.getTextRange().contains(component.getTextOffset())) {
//             return component;
//         }
//         return null;
//     }
// }


import com.intellij.lang.ASTNode;
import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.lang.javascript.psi.JSDefinitionExpression;
import com.intellij.lang.javascript.psi.impl.JSBinaryExpressionImpl;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.PsiLanguageInjectionHost;
import com.intellij.psi.PsiReference;
import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.xml.XmlAttribute;
import org.emberjs.codeInsight.ComponentUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
package org.emberjs.lang.psi;


/**
 * @author Dennis.Ushakov
 */
public class EmberJSAsExpression extends JSBinaryExpressionImpl {
    public EmberJSAsExpression(ASTNode node) {
        super(node);
    }

    @Nullable
    public JSDefinitionExpression getDefinition() {
        return PsiTreeUtil.getChildOfType(this, JSDefinitionExpression.class);
    }

    @Override
// Path: src/org/emberjs/codeInsight/ComponentUtil.java
// public class ComponentUtil {
//     public static String getAttributeName(final String text) {
//         final String[] split = StringUtil.unquoteString(text).split("(?=[A-Z])");
//         for (int i = 0; i < split.length; i++) {
//             split[i] = StringUtil.decapitalize(split[i]);
//         }
//         return StringUtil.join(split, "-");
//     }
// 
//     public static String attributeToComponent(String name) {
//         final String[] words = name.split("-");
//         for (int i = 1; i < words.length; i++) {
//             words[i] = StringUtil.capitalize(words[i]);
//         }
//         return StringUtil.join(words);
//     }
// 
//     public static boolean processComponents(final Project project,
//                                                Processor<JSNamedElementProxy> processor) {
//         final Collection<String> docComponents = EmberIndexUtil.getAllKeys(EmberComponentDocIndex.INDEX_ID, project);
//         for (String componentName : docComponents) {
//             final JSNamedElementProxy component = getComponentProxy(project, componentName, EmberComponentDocIndex.INDEX_ID);
//             if (component != null) {
//                 if (!processor.process(component)) {
//                     return false;
//                 }
//             }
//         }
//         final Collection<String> components = EmberIndexUtil.getAllKeys(EmberComponentIndex.INDEX_ID, project);
//         for (String componentName : components) {
//             if (!docComponents.contains(componentName)) {
//                 final JSNamedElementProxy component = getComponentProxy(project, componentName, EmberComponentIndex.INDEX_ID);
//                 if (component != null) {
//                     if (!processor.process(component)) {
//                         return false;
//                     }
//                 }
//             }
//         }
//         return true;
//     }
// 
//     public static JSNamedElementProxy getComponentProxy(String componentName, Project project) {
//         final JSNamedElementProxy component = getComponentProxy(project, componentName, EmberComponentDocIndex.INDEX_ID);
//         return component == null ? getComponentProxy(project, componentName, EmberComponentIndex.INDEX_ID) : component;
//     }
// 
//     private static JSNamedElementProxy getComponentProxy(Project project, String componentName, final ID<String, Void> index) {
//         final JSNamedElementProxy component = EmberIndexUtil.resolve(project, index, componentName);
//         // TODO: do some stuff??
//         return null;
//     }
// 
//     @Nullable
//     public static JSNamedElementProxy getComponent(@Nullable PsiElement element) {
//         if (element instanceof JSNamedElementProxy) {
//             return getComponent(element, ((JSNamedElementProxy)element).getName());
//         }
//         if (element instanceof JSLiteralExpression && ((JSLiteralExpression)element).isQuotedLiteral()) {
//             return getComponent(element, StringUtil.unquoteString(element.getText()));
//         }
//         return null;
//     }
// 
//     private static JSNamedElementProxy getComponent(PsiElement element, final String name) {
//         final String componentName = getAttributeName(name);
//         final JSNamedElementProxy component = EmberIndexUtil.resolve(element.getProject(), EmberComponentIndex.INDEX_ID, componentName);
//         if (component != null && element.getTextRange().contains(component.getTextOffset())) {
//             return component;
//         }
//         return null;
//     }
// }


// Path: src/org/emberjs/lang/psi/EmberJSAsExpression.java
import com.intellij.lang.ASTNode;
import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.lang.javascript.psi.JSDefinitionExpression;
import com.intellij.lang.javascript.psi.impl.JSBinaryExpressionImpl;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.PsiLanguageInjectionHost;
import com.intellij.psi.PsiReference;
import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.xml.XmlAttribute;
import org.emberjs.codeInsight.ComponentUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

package org.emberjs.lang.psi;


/**
 * @author Dennis.Ushakov
 */
public class EmberJSAsExpression extends JSBinaryExpressionImpl {
    public EmberJSAsExpression(ASTNode node) {
        super(node);
    }

    @Nullable
    public JSDefinitionExpression getDefinition() {
        return PsiTreeUtil.getChildOfType(this, JSDefinitionExpression.class);
    }

    @Override
    public void accept(@NotNull PsiElementVisitor visitor) {