MavenIndexerWrapper (@NotNull Project project) { String path = project.getBasePath(); if (path == null) { path = new File(".").getPath(); } String finalPath = path; if (MavenWslUtil.tryGetWslDistributionForPath(path) != null) { return new MavenIndexerWrapper(null) { @Override protected MavenIndices createMavenIndices(Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; } @Override protected @NotNull MavenServerIndexer create() { return new DummyIndexer(); } }; } return new MavenIndexerWrapper(null) { @Override protected MavenIndices createMavenIndices(Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; } @NotNull @Override protected MavenServerIndexer create() throws RemoteException { MavenServerConnector connector; synchronized (myMultimoduleDirToConnectorMap) { connector = ContainerUtil.find(myMultimoduleDirToConnectorMap.values(), c -> ContainerUtil.find( c.getMultimoduleDirectories(), mDir -> FileUtil .isAncestor(finalPath, mDir, false)) != null ); } if (connector != null) { return connector.createIndexer(); } String workingDirectory = ObjectUtils.chooseNotNull(project.getBasePath(), SystemUtils.getUserHome().getAbsolutePath()); return MavenServerManagerImpl.this.getConnector(project, workingDirectory).createIndexer(); } }; }