<commit_before>package com.intellij.lang.ant.psi.impl.reference.providers;

import com.intellij.lang.ant.psi.AntTarget;
import com.intellij.lang.ant.psi.impl.reference.AntTargetReference;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.psi.impl.source.resolve.reference.ReferenceType;
import com.intellij.psi.xml.XmlAttribute;
import org.jetbrains.annotations.NotNull;

public class AntTargetListReferenceProvider extends AntTargetReferenceProviderBase {

  @NotNull
  public PsiReference[] getReferencesByElement(PsiElement element) {
    final AntTarget target = (AntTarget)element;
    final XmlAttribute attr = target.getSourceElement().getAttribute("depends", null);
    if (attr == null) {
      return PsiReference.EMPTY_ARRAY;
    }
    int offsetInPosition = attr.getValueElement().getTextRange().getStartOffset() - target.getTextRange().getStartOffset() + 1;
    final String str = attr.getValue();
    final String[] targets = str.split(",");
    final int length = targets.length;
    if (length == 0) {
      return PsiReference.EMPTY_ARRAY;
    }
    PsiReference[] result = new PsiReference[length];
    for (int i = 0; i < result.length; i++) {
      final String t = targets[i];
      result[i] = new AntTargetReference(this, target, t, new TextRange(offsetInPosition, offsetInPosition + t.length()), attr);
      offsetInPosition += t.length() + 1;
    }
    return result;
  }

  @NotNull
  public PsiReference[] getReferencesByElement(PsiElement element, ReferenceType type) {
    return getReferencesByElement(element);
  }
<commit_msg>trim targets in the depends list<commit_after>package com.intellij.lang.ant.psi.impl.reference.providers;

import com.intellij.lang.ant.psi.AntTarget;
import com.intellij.lang.ant.psi.impl.reference.AntTargetReference;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.psi.impl.source.resolve.reference.ReferenceType;
import com.intellij.psi.xml.XmlAttribute;
import org.jetbrains.annotations.NotNull;

public class AntTargetListReferenceProvider extends AntTargetReferenceProviderBase {

  @NotNull
  public PsiReference[] getReferencesByElement(PsiElement element) {
    final AntTarget target = (AntTarget)element;
    final XmlAttribute attr = target.getSourceElement().getAttribute("depends", null);
    if (attr == null) {
      return PsiReference.EMPTY_ARRAY;
    }
    int offsetInPosition = attr.getValueElement().getTextRange().getStartOffset() - target.getTextRange().getStartOffset() + 1;
    final String str = attr.getValue();
    final String[] targets = str.split(",");
    final int length = targets.length;
    if (length == 0) {
      return PsiReference.EMPTY_ARRAY;
    }
    PsiReference[] result = new PsiReference[length];
    for (int i = 0; i < result.length; i++) {
      final String t = targets[i].trim();
      result[i] = new AntTargetReference(this, target, t, new TextRange(offsetInPosition, offsetInPosition + t.length()), attr);
      offsetInPosition += t.length() + 1;
    }
    return result;
  }

  @NotNull
  public PsiReference[] getReferencesByElement(PsiElement element, ReferenceType type) {
    return getReferencesByElement(element);
  }

{'fraction_non_alphanumeric': 0.1141566265060241, 'fraction_numerical': 0.0024096385542168677, 'mean_word_length': 4.525790349417638, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5568766', 'n_tokens_mistral': 988, 'n_tokens_neox': 971, 'n_words': 211}