mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
no duplicates in java var name suggestions
This commit is contained in:
+7
@@ -361,11 +361,18 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor {
|
||||
}
|
||||
|
||||
private static void addLookupItems(Set<LookupElement> lookupElements, @Nullable final SuggestedNameInfo callback, PrefixMatcher matcher, String... strings) {
|
||||
outer:
|
||||
for (int i = 0; i < strings.length; i++) {
|
||||
String name = strings[i];
|
||||
if (!matcher.prefixMatches(name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (LookupElement lookupElement : lookupElements) {
|
||||
if (lookupElement.getAllLookupStrings().contains(name)) {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
|
||||
LookupElement element = PrioritizedLookupElement.withPriority(LookupElementBuilder.create(name).withAutoCompletionPolicy(AutoCompletionPolicy.GIVE_CHANCE_TO_OVERWRITE), -i);
|
||||
if (callback != null) {
|
||||
|
||||
Reference in New Issue
Block a user