@Ignore("T73932936") @Test public void getAllClassNames() throws IOException { final Project project = testHelper.getFixture().getProject(); final PsiFile file = testHelper.configure("LayoutSpec.java"); ApplicationManager.getApplication() .invokeAndWait( () -> { final ComponentShortNamesCache namesCache = new ComponentShortNamesCache(project); final PsiClass cls = PsiTreeUtil.findChildOfType(file, PsiClass.class); ComponentGenerateService.getInstance().updateLayoutComponentAsync(cls); final String[] allClassNames = namesCache.getAllClassNames(); assertThat(allClassNames.length).isOne(); assertThat(allClassNames[0]).isEqualTo("Layout"); }); }
@Override public String[] getAllClassNames() { return Arrays.stream(ComponentsCacheService.getInstance(project).getAllComponents()) .map(cls -> StringUtil.getShortName(cls.getQualifiedName())) .toArray(String[]::new); }
ComponentShortNamesCache extends PsiShortNamesCache { @Override public String[] getAllClassNames() { return Arrays.stream(ComponentsCacheService.getInstance(project).getAllComponents()) .map(cls -> StringUtil.getShortName(cls.getQualifiedName())) .toArray(String[]::new); } }
ComponentShortNamesCache extends PsiShortNamesCache { @Override public String[] getAllClassNames() { return Arrays.stream(ComponentsCacheService.getInstance(project).getAllComponents()) .map(cls -> StringUtil.getShortName(cls.getQualifiedName())) .toArray(String[]::new); } ComponentShortNamesCache(Project project); }
ComponentShortNamesCache extends PsiShortNamesCache { @Override public String[] getAllClassNames() { return Arrays.stream(ComponentsCacheService.getInstance(project).getAllComponents()) .map(cls -> StringUtil.getShortName(cls.getQualifiedName())) .toArray(String[]::new); } ComponentShortNamesCache(Project project); @Override PsiClass[] getClassesByName(String name, GlobalSearchScope scope); @Override String[] getAllClassNames(); @Override PsiMethod[] getMethodsByName(String name, GlobalSearchScope scope); @Override PsiMethod[] getMethodsByNameIfNotMoreThan(
      String name, GlobalSearchScope scope, int maxCount); @Override PsiField[] getFieldsByNameIfNotMoreThan(
      String name, GlobalSearchScope scope, int maxCount); @Override boolean processMethodsWithName(
      String name, GlobalSearchScope scope, Processor<PsiMethod> processor); @Override String[] getAllMethodNames(); @Override PsiField[] getFieldsByName(String name, GlobalSearchScope scope); @Override String[] getAllFieldNames(); }
ComponentShortNamesCache extends PsiShortNamesCache { @Override public String[] getAllClassNames() { return Arrays.stream(ComponentsCacheService.getInstance(project).getAllComponents()) .map(cls -> StringUtil.getShortName(cls.getQualifiedName())) .toArray(String[]::new); } ComponentShortNamesCache(Project project); @Override PsiClass[] getClassesByName(String name, GlobalSearchScope scope); @Override String[] getAllClassNames(); @Override PsiMethod[] getMethodsByName(String name, GlobalSearchScope scope); @Override PsiMethod[] getMethodsByNameIfNotMoreThan(
      String name, GlobalSearchScope scope, int maxCount); @Override PsiField[] getFieldsByNameIfNotMoreThan(
      String name, GlobalSearchScope scope, int maxCount); @Override boolean processMethodsWithName(
      String name, GlobalSearchScope scope, Processor<PsiMethod> processor); @Override String[] getAllMethodNames(); @Override PsiField[] getFieldsByName(String name, GlobalSearchScope scope); @Override String[] getAllFieldNames();  }