@Override
    public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
      if (!(element instanceof PsiFile)) throw new IncorrectOperationException("PsiFile expected");
      if (isReferenceTo(element)) return PsiSnippetAttributeValueImpl.this;
      VirtualFile virtualFile = ((PsiFile)element).getVirtualFile();
      String relativePath = VfsUtilCore.getRelativePath(virtualFile, mySnippetRoot, '.');
      if (relativePath == null) {
        throw new IncorrectOperationException("File not in " + mySnippetRoot + ": " + virtualFile);
      }
      if (myExtension != null) {
        if (!StringUtil.endsWithIgnoreCase(relativePath, "." + myExtension)) {
          throw new IncorrectOperationException("File name must end with ." + myExtension + ": " + virtualFile);
        }
        relativePath = relativePath.substring(0, relativePath.length() - myExtension.length() - 1);
      }
      String newText;
      if (!relativePath.contains(mySeparator)) {
        newText = relativePath;
      }
      else if (getText().startsWith("'")) {
        newText = "'" + relativePath + "'";
      }
      else {
        newText = "\"" + relativePath + "\"";
      }
      ASTNode node = getNode();
      LeafElement newNode = ChangeUtil.copyLeafWithText((LeafElement)node, newText);
      node.getTreeParent().replaceChild(node, newNode);
      return newNode.getPsi();
    }
@Override
    public PsiElement bindToElement(@NotNull PsiElement element)