void (final List<Object> result, Set<String> variants) { int prefixLength = 0; if (myText.startsWith("pom.")) { prefixLength = "pom.".length(); } else if (myText.startsWith("project.")) { prefixLength = "project.".length(); } MavenProject mavenProject = myMavenProject; while (myText.startsWith("parent.", prefixLength)) { MavenId parentId = mavenProject.getParentId(); if (parentId == null) return; mavenProject = myProjectsManager.findProject(parentId); if (mavenProject == null) return; prefixLength += "parent.".length(); } final String prefix = prefixLength == 0 ? null : myText.substring(0, prefixLength); PsiDirectory baseDir = getBaseDir(mavenProject); addVariant(result, "basedir", baseDir, prefix, RepositoryLibraryLogo); if (prefix == null) { result.add(createLookupElement(baseDir, "project.baseUri", RepositoryLibraryLogo)); result.add(createLookupElement(baseDir, "pom.baseUri", RepositoryLibraryLogo)); result.add(LookupElementBuilder.create(TIMESTAMP_PROP).withIcon(RepositoryLibraryLogo)); result.add(LookupElementBuilder.create(MULTIPROJECT_DIR_PROP).withIcon(RepositoryLibraryLogo)); } processSchema(MavenSchemaProvider.MAVEN_PROJECT_SCHEMA_URL, (property, descriptor) -> { if (property.startsWith("project.")) { addVariant(result, property.substring("project.".length()), descriptor, prefix, RepositoryLibraryLogo); } return null; }); processSchema(MavenSchemaProvider.MAVEN_SETTINGS_SCHEMA_URL_1_2, (property, descriptor) -> { result.add(createLookupElement(descriptor, property, RepositoryLibraryLogo)); return null; }); collectPropertiesVariants(result, variants); collectSystemEnvProperties(MavenPropertiesVirtualFileSystem.SYSTEM_PROPERTIES_FILE, null, result, variants); collectSystemEnvProperties(MavenPropertiesVirtualFileSystem.ENV_PROPERTIES_FILE, "env.", result, variants); MavenRunnerSettings runnerSettings = MavenRunner.getInstance(myProject).getSettings(); for (String prop : runnerSettings.getMavenProperties().keySet()) { if (variants.add(prefix)) { result.add(LookupElementBuilder.create(prop).withIcon(PlatformIcons.PROPERTY_ICON)); } } for (String prop : MavenUtil.getPropertiesFromMavenOpts().keySet()) { if (variants.add(prop)) { result.add(LookupElementBuilder.create(prop).withIcon(PlatformIcons.PROPERTY_ICON)); } } for (String property : myMavenProject.getMavenConfig().keySet()) { if (variants.add(property)) { result.add(LookupElementBuilder.create(property).withIcon(PlatformIcons.PROPERTY_ICON)); } } for (String property : myMavenProject.getJvmConfig().keySet()) { if (variants.add(property)) { result.add(LookupElementBuilder.create(property).withIcon(PlatformIcons.PROPERTY_ICON)); } } for (Object key : myMavenProject.getProperties().keySet()) { if (key instanceof String property) { if (variants.add(property)) { result.add(LookupElementBuilder.create(property).withIcon(PlatformIcons.PROPERTY_ICON)); } } } MavenDomConfiguration pluginCfg = DomUtil.findDomElement(myElement, MavenDomConfiguration.class); if (pluginCfg != null) { MavenPluginDescriptor.processDescriptors(descriptor -> { if (descriptor.properties != null) { for (MavenPluginDescriptor.ModelProperty property : descriptor.properties) { if (property.insideConfigurationOnly) { result.add(LookupElementBuilder.create(property.name).withIcon(PlatformIcons.PROPERTY_ICON)); } } } return true; }, pluginCfg); } }