void (@NotNull CompletionResultSet completionResultSet, @NotNull Project project, @Nullable String groupId, @Nullable String artifactId, @NotNull String prefix) { if (StringUtil.isEmptyOrSpaces(artifactId)) return; CompletionResultSet newResultSet = completionResultSet.withRelevanceSorter(CompletionService.getCompletionService().emptySorter().weigh( new LookupElementWeigher("mavenVersionWeigher") { @Nullable @Override public Comparable weigh(@NotNull LookupElement element) { return new NegatingComparable(new MavenVersionComparable(StringUtil.trimStart(element.getLookupString(), prefix))); } })); Set<String> versions; if (StringUtil.isEmptyOrSpaces(groupId)) { versions = Collections.emptySet(); //if (!(coordinates instanceof MavenDomPlugin)) return; // //versions = indicesManager.getVersions(MavenArtifactUtil.DEFAULT_GROUPS[0], artifactId); //for (int i = 0; i < MavenArtifactUtil.DEFAULT_GROUPS.length; i++) { // versions = Sets.union(versions, indicesManager.getVersions(MavenArtifactUtil.DEFAULT_GROUPS[i], artifactId)); //} } else { versions = DependencySearchService.getInstance(project).getVersions(groupId, artifactId); } for (String version : versions) { newResultSet.addElement(LookupElementBuilder.create(prefix + version)); } newResultSet.addElement(LookupElementBuilder.create(prefix + RepositoryLibraryDescription.ReleaseVersionId)); newResultSet.addElement(LookupElementBuilder.create(prefix + RepositoryLibraryDescription.LatestVersionId)); }