simple language: cleanup SimpleReference

This commit is contained in:
Yann Cébron 2023-10-25 13:48:54 +02:00
parent 420cc1a328
commit 742a193219

View File

@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.intellij.sdk.language; package org.intellij.sdk.language;
@ -14,11 +14,11 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class SimpleReference extends PsiReferenceBase<PsiElement> implements PsiPolyVariantReference { final class SimpleReference extends PsiReferenceBase<PsiElement> implements PsiPolyVariantReference {
private final String key; private final String key;
public SimpleReference(@NotNull PsiElement element, TextRange textRange) { SimpleReference(@NotNull PsiElement element, TextRange textRange) {
super(element, textRange); super(element, textRange);
key = element.getText().substring(textRange.getStartOffset(), textRange.getEndOffset()); key = element.getText().substring(textRange.getStartOffset(), textRange.getEndOffset());
} }
@ -31,7 +31,7 @@ public class SimpleReference extends PsiReferenceBase<PsiElement> implements Psi
for (SimpleProperty property : properties) { for (SimpleProperty property : properties) {
results.add(new PsiElementResolveResult(property)); results.add(new PsiElementResolveResult(property));
} }
return results.toArray(new ResolveResult[results.size()]); return results.toArray(new ResolveResult[0]);
} }
@Nullable @Nullable