void (@NotNull CompletionResultSet result) { List<LookupElement> cachedElements = myCachedElements; final String projectPath = myProjectPathAccessor.getText(); if (cachedElements == null || !StringUtil.equals(myCachedWorkingDir, projectPath)) { final ExternalProjectSettings linkedProjectSettings = ExternalSystemApiUtil.getSettings(myProject, mySystemId).getLinkedProjectSettings(projectPath); if (linkedProjectSettings == null) return; final ExternalProjectInfo projectData = ProjectDataManager.getInstance().getExternalProjectData(myProject, mySystemId, linkedProjectSettings.getExternalProjectPath()); if (projectData == null || projectData.getExternalProjectStructure() == null) return; cachedElements = new ArrayList<>(getVariants(projectData.getExternalProjectStructure(), projectPath)); myCachedElements = cachedElements; myCachedWorkingDir = projectPath; } result.addAllElements(cachedElements); }