use of com.intellij.openapi.util.text.DelimitedListProcessor in project intellij-community by JetBrains.
the class DelimitedListConverter method createReferences.
@Override
@NotNull
public PsiReference[] createReferences(final GenericDomValue<List<T>> genericDomValue, final PsiElement element, final ConvertContext context) {
final String text = genericDomValue.getRawText();
if (text == null) {
return PsiReference.EMPTY_ARRAY;
}
final ArrayList<PsiReference> references = new ArrayList<>();
new DelimitedListProcessor(myDelimiters) {
@Override
protected void processToken(final int start, final int end, final boolean delimitersOnly) {
references.add(createPsiReference(element, start + 1, end + 1, context, genericDomValue, delimitersOnly));
}
}.processText(text);
return references.toArray(new PsiReference[references.size()]);
}
use of com.intellij.openapi.util.text.DelimitedListProcessor in project intellij-community by JetBrains.
the class DelimitedListProcessorTest method doTest.
private void doTest(final String text, final List<String> expected) {
final ArrayList<String> tokens = new ArrayList<>();
new DelimitedListProcessor(";") {
@Override
protected void processToken(final int start, final int end, final boolean delimitersOnly) {
tokens.add(text.substring(start, end));
}
}.processText(text);
assertEquals(expected, tokens);
}
Aggregations