// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.yaml.navigation;

import com.intellij.ide.actions.QualifiedNameProvider;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.yaml.YAMLUtil;

public class YAMLQualifiedNameProvider implements QualifiedNameProvider {
  @Nullable
  @Override
  public PsiElement adjustElementToCopy(PsiElement element) {
    return null;
  }

  @Nullable
  @Override
  public String getQualifiedName(PsiElement element) {
    return YAMLUtil.getConfigFullName(element);
  }

  @Nullable
  @Override
  public PsiElement qualifiedNameToElement(String fqn, Project project) {
    return null;
  }
}

@@ -388,16 +388,62 @@
 AMLUtil;
+%0Aimport org.jetbrains.yaml.psi.YAMLPsiElement;
 %0A%0Apublic
@@ -707,16 +707,52 @@
   return
+ element instanceof YAMLPsiElement ?
  YAMLUti
@@ -779,16 +779,23 @@
 element)
+ : null
 ;%0A  %7D%0A%0A 

fix YAMLQualifiedNameProvider not to mess with non-YAML files