com.intellij.psi.search.searches.ClassInheritorsSearch#com.intellij.util.containers.MultiMap源码实例Demo

下面列出了com.intellij.psi.search.searches.ClassInheritorsSearch#com.intellij.util.containers.MultiMap 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: flutter-intellij   文件: AndroidUtils.java
public static void enableCoeditIfAddToAppDetected(@NotNull Project project) {
  if (isCoeditTransformedProject(project)) {
    return;
  }
  // After a Gradle sync has finished we check the tasks that were run to see if any belong to Flutter.
  Map<ProjectData, MultiMap<String, String>> tasks = getTasksMap(project);
  @NotNull String projectName = project.getName();
  for (ProjectData projectData : tasks.keySet()) {
    MultiMap<String, String> map = tasks.get(projectData);
    Collection<String> col = map.get(FLUTTER_PROJECT_NAME);
    if (col.isEmpty()) {
      col = map.get(""); // Android Studio uses this.
    }
    if (!col.isEmpty()) {
      if (col.parallelStream().anyMatch((x) -> x.startsWith(FLUTTER_TASK_PREFIX))) {
        ApplicationManager.getApplication().invokeLater(() -> enableCoEditing(project));
      }
    }
  }
}
 
源代码2 项目: consulo   文件: FileIncludeManagerImpl.java
@Override
public void processIncludingFiles(PsiFile context, Processor<? super Pair<VirtualFile, FileIncludeInfo>> processor) {
  context = context.getOriginalFile();
  VirtualFile contextFile = context.getVirtualFile();
  if (contextFile == null) return;

  String originalName = context.getName();
  Collection<String> names = getPossibleIncludeNames(context, originalName);

  GlobalSearchScope scope = GlobalSearchScope.allScope(myProject);
  for (String name : names) {
    MultiMap<VirtualFile, FileIncludeInfoImpl> infoList = FileIncludeIndex.getIncludingFileCandidates(name, scope);
    for (VirtualFile candidate : infoList.keySet()) {
      PsiFile psiFile = myPsiManager.findFile(candidate);
      if (psiFile == null || context.equals(psiFile)) continue;
      for (FileIncludeInfo info : infoList.get(candidate)) {
        PsiFileSystemItem item = resolveFileInclude(info, psiFile);
        if (item != null && contextFile.equals(item.getVirtualFile())) {
          if (!processor.process(Pair.create(candidate, info))) {
            return;
          }
        }
      }
    }
  }
}
 
源代码3 项目: consulo   文件: BaseRefactoringProcessor.java
protected boolean showConflicts(@Nonnull MultiMap<PsiElement, String> conflicts, @Nullable final UsageInfo[] usages) {
  if (!conflicts.isEmpty() && ApplicationManager.getApplication().isUnitTestMode()) {
    if (!ConflictsInTestsException.isTestIgnore()) throw new ConflictsInTestsException(conflicts.values());
    return true;
  }

  if (myPrepareSuccessfulSwingThreadCallback != null && !conflicts.isEmpty()) {
    final String refactoringId = getRefactoringId();
    if (refactoringId != null) {
      RefactoringEventData conflictUsages = new RefactoringEventData();
      conflictUsages.putUserData(RefactoringEventData.CONFLICTS_KEY, conflicts.values());
      myProject.getMessageBus().syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC).conflictsDetected(refactoringId, conflictUsages);
    }
    final ConflictsDialog conflictsDialog = prepareConflictsDialog(conflicts, usages);
    if (!conflictsDialog.showAndGet()) {
      if (conflictsDialog.isShowConflicts()) prepareSuccessful();
      return false;
    }
  }

  prepareSuccessful();
  return true;
}
 
public VcsAnnotationLocalChangesListenerImpl(Project project, final ProjectLevelVcsManager vcsManager) {
  myLock = new Object();
  myUpdateStuff = createUpdateStuff();
  myUpdater = new ZipperUpdater(ApplicationManager.getApplication().isUnitTestMode() ? 10 : 300, Alarm.ThreadToUse.POOLED_THREAD, project);
  myConnection = project.getMessageBus().connect();
  myLocalFileSystem = LocalFileSystem.getInstance();
  VcsAnnotationRefresher handler = createHandler();
  myDirtyPaths = new HashSet<>();
  myDirtyChanges = new HashMap<>();
  myDirtyFiles = new HashSet<>();
  myFileAnnotationMap = MultiMap.createSet();
  myVcsManager = vcsManager;
  myVcsKeySet = new HashSet<>();

  myConnection.subscribe(VcsAnnotationRefresher.LOCAL_CHANGES_CHANGED, handler);
}
 
private static MultiMap<String, NamespaceReference> buildCache(File key, String libraryName)
{
	try
	{
		MultiMap<String, NamespaceReference> map = new MultiMap<String, NamespaceReference>();
		TypeDef[] typeDefs = new ModuleParser(key).getTypeDefs();

		for(TypeDef typeDef : typeDefs)
		{
			String namespace = typeDef.getNamespace();
			if(StringUtil.isEmpty(namespace))
			{
				continue;
			}
			map.putValue(MsilHelper.cutGenericMarker(typeDef.getName()), new NamespaceReference(namespace, libraryName));
		}
		return map;
	}
	catch(IOException | MSILParseException ignored)
	{
	}
	return MultiMap.emptyInstance();
}
 
源代码6 项目: consulo   文件: StatisticsWeigher.java
private TreeMap<Integer, List<LookupElement>> buildMapByWeight(Iterable<LookupElement> source) {
  MultiMap<String, LookupElement> byName = MultiMap.create();
  List<LookupElement> noStats = new ArrayList<>();
  for (LookupElement element : source) {
    String string = element.getLookupString();
    if (myStringsWithWeights.contains(string)) {
      byName.putValue(string, element);
    } else {
      noStats.add(element);
    }
  }

  TreeMap<Integer, List<LookupElement>> map = new TreeMap<>();
  map.put(0, noStats);
  for (String s : byName.keySet()) {
    List<LookupElement> group = (List<LookupElement>)byName.get(s);
    Collections.sort(group, Comparator.comparing(this::getScalarWeight).reversed());
    map.computeIfAbsent(getMaxWeight(group), __ -> new ArrayList<>()).addAll(group);
  }
  return map;
}
 
源代码7 项目: consulo   文件: VcsDirtyScopeManagerImpl.java
@Nonnull
private VcsInvalidated calculateInvalidated(@Nonnull DirtBuilder dirt) {
  MultiMap<AbstractVcs, FilePath> files = dirt.getFilesForVcs();
  MultiMap<AbstractVcs, FilePath> dirs = dirt.getDirsForVcs();
  if (dirt.isEverythingDirty()) {
    dirs.putAllValues(getEverythingDirtyRoots());
  }
  Set<AbstractVcs> keys = ContainerUtil.union(files.keySet(), dirs.keySet());

  Map<AbstractVcs, VcsDirtyScopeImpl> scopes = ContainerUtil.newHashMap();
  for (AbstractVcs key : keys) {
    VcsDirtyScopeImpl scope = new VcsDirtyScopeImpl(key, myProject);
    scopes.put(key, scope);
    scope.addDirtyData(dirs.get(key), files.get(key));
  }

  return new VcsInvalidated(new ArrayList<>(scopes.values()), dirt.isEverythingDirty());
}
 
源代码8 项目: consulo   文件: RootIndex.java
private static OrderEntry[] calcOrderEntries(@Nonnull RootInfo info,
                                             @Nonnull MultiMap<VirtualFile, OrderEntry> depEntries,
                                             @Nonnull MultiMap<VirtualFile, OrderEntry> libClassRootEntries,
                                             @Nonnull MultiMap<VirtualFile, OrderEntry> libSourceRootEntries,
                                             @Nonnull List<VirtualFile> hierarchy) {
  @Nullable VirtualFile libraryClassRoot = info.findLibraryRootInfo(hierarchy, false);
  @Nullable VirtualFile librarySourceRoot = info.findLibraryRootInfo(hierarchy, true);
  Set<OrderEntry> orderEntries = ContainerUtil.newLinkedHashSet();
  orderEntries.addAll(info.getLibraryOrderEntries(hierarchy, libraryClassRoot, librarySourceRoot, libClassRootEntries, libSourceRootEntries));
  for (VirtualFile root : hierarchy) {
    orderEntries.addAll(depEntries.get(root));
  }
  VirtualFile moduleContentRoot = info.findModuleRootInfo(hierarchy);
  if (moduleContentRoot != null) {
    ContainerUtil.addIfNotNull(orderEntries, info.getModuleSourceEntry(hierarchy, moduleContentRoot, libClassRootEntries));
  }
  if (orderEntries.isEmpty()) {
    return null;
  }

  OrderEntry[] array = orderEntries.toArray(new OrderEntry[orderEntries.size()]);
  Arrays.sort(array, RootIndex.BY_OWNER_MODULE);
  return array;
}
 
源代码9 项目: consulo   文件: RootIndex.java
@Nonnull
private LinkedHashSet<OrderEntry> getLibraryOrderEntries(@Nonnull List<VirtualFile> hierarchy,
                                                         @Nullable VirtualFile libraryClassRoot,
                                                         @Nullable VirtualFile librarySourceRoot,
                                                         @Nonnull MultiMap<VirtualFile, OrderEntry> libClassRootEntries,
                                                         @Nonnull MultiMap<VirtualFile, OrderEntry> libSourceRootEntries) {
  LinkedHashSet<OrderEntry> orderEntries = ContainerUtil.newLinkedHashSet();
  for (VirtualFile root : hierarchy) {
    if (root == libraryClassRoot && !sourceRootOf.containsKey(root)) {
      orderEntries.addAll(libClassRootEntries.get(root));
    }
    if (root == librarySourceRoot && libraryClassRoot == null) {
      orderEntries.addAll(libSourceRootEntries.get(root));
    }
    if (libClassRootEntries.containsKey(root) || sourceRootOf.containsKey(root) && librarySourceRoot == null) {
      break;
    }
  }
  return orderEntries;
}
 
源代码10 项目: consulo   文件: ArtifactCompilerUtil.java
public static MultiMap<String, Artifact> createOutputToArtifactMap(final Project project) {
  final MultiMap<String, Artifact> result = new MultiMap<String, Artifact>() {
    @Nonnull
    @Override
    protected Map<String, Collection<Artifact>> createMap() {
      return new THashMap<String, Collection<Artifact>>(FileUtil.PATH_HASHING_STRATEGY);
    }
  };
  AccessRule.read(() -> {
    for (Artifact artifact : ArtifactManager.getInstance(project).getArtifacts()) {
      String outputPath = artifact.getOutputFilePath();
      if (!StringUtil.isEmpty(outputPath)) {
        result.putValue(outputPath, artifact);
      }
    }
  });
  return result;
}
 
源代码11 项目: consulo   文件: LiveTemplateSettingsEditor.java
private void addContextNode(MultiMap<TemplateContextType, TemplateContextType> hierarchy,
                            CheckedTreeNode parent,
                            TemplateContextType type) {
  final Collection<TemplateContextType> children = hierarchy.get(type);
  final String name = UIUtil.removeMnemonic(type.getPresentableName());
  final CheckedTreeNode node = new CheckedTreeNode(Pair.create(children.isEmpty() ? type : null, name));
  parent.add(node);

  if (children.isEmpty()) {
    node.setChecked(myContext.get(type));
  }
  else {
    for (TemplateContextType child : children) {
      addContextNode(hierarchy, node, child);
    }
    final CheckedTreeNode other = new CheckedTreeNode(Pair.create(type, "Other"));
    other.setChecked(myContext.get(type));
    node.add(other);
  }
}
 
private void processUnderFile(VirtualFile file) {
  final MultiMap<VirtualFile, FileAnnotation> annotations = new MultiMap<>();
  synchronized (myLock) {
    for (VirtualFile virtualFile : myFileAnnotationMap.keySet()) {
      if (VfsUtilCore.isAncestor(file, virtualFile, true)) {
        final Collection<FileAnnotation> values = myFileAnnotationMap.get(virtualFile);
        for (FileAnnotation value : values) {
          annotations.putValue(virtualFile, value);
        }
      }
    }
  }
  if (! annotations.isEmpty()) {
    for (Map.Entry<VirtualFile, Collection<FileAnnotation>> entry : annotations.entrySet()) {
      final VirtualFile key = entry.getKey();
      final VcsRevisionNumber number = fromDiffProvider(key);
      if (number == null) continue;
      final Collection<FileAnnotation> fileAnnotations = entry.getValue();
      for (FileAnnotation annotation : fileAnnotations) {
        if (annotation.isBaseRevisionChanged(number)) {
          annotation.close();
        }
      }
    }
  }
}
 
源代码13 项目: consulo   文件: VcsLogRepoSizeCollector.java
@Nonnull
@Override
public Set<UsageDescriptor> getProjectUsages(@Nonnull Project project) throws CollectUsagesException {
  VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
  VcsLogData logData = projectLog.getDataManager();
  if (logData != null) {
    DataPack dataPack = logData.getDataPack();
    if (dataPack.isFull()) {
      PermanentGraph<Integer> permanentGraph = dataPack.getPermanentGraph();
      MultiMap<VcsKey, VirtualFile> groupedRoots = groupRootsByVcs(dataPack.getLogProviders());

      Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
      usages.add(StatisticsUtilKt.getCountingUsage("data.commit.count", permanentGraph.getAllCommits().size(),
                                                   asList(0, 1, 100, 1000, 10 * 1000, 100 * 1000, 500 * 1000)));
      for (VcsKey vcs : groupedRoots.keySet()) {
        usages.add(StatisticsUtilKt.getCountingUsage("data." + vcs.getName().toLowerCase() + ".root.count", groupedRoots.get(vcs).size(),
                                                     asList(0, 1, 2, 5, 8, 15, 30, 50, 100, 500, 1000)));
      }
      return usages;
    }
  }
  return Collections.emptySet();
}
 
源代码14 项目: consulo   文件: VcsLogUserFilterTest.java
public void testWeirdCharacters() throws Exception {
  List<String> names = ContainerUtil.newArrayList();

  for (Character c : UserNameRegex.EXTENDED_REGEX_CHARS) {
    String name = "user" + Character.toString(c) + "userovich" + c.hashCode(); // hashCode is required so that uses wont be synonyms
    names.add(name);
    names.add(name + "@company.com");
  }

  MultiMap<VcsUser, String> commits = generateHistory(ArrayUtil.toStringArray(names));
  List<VcsCommitMetadata> metadata = generateMetadata(commits);

  StringBuilder builder = new StringBuilder();
  for (VcsUser user : commits.keySet()) {
    checkFilterForUser(user, commits.keySet(), commits.get(user), metadata, builder);
  }
  assertFilteredCorrectly(builder);
}
 
源代码15 项目: consulo   文件: CheckinHandlersManagerImpl.java
public CheckinHandlersManagerImpl() {
  myVcsMap = new MultiMap<>();
  myRegisteredBeforeCheckinHandlers = new ArrayList<>();

  myRegisteredBeforeCheckinHandlers.addAll(CheckinHandlerFactory.EP_NAME.getExtensionList());
  for (VcsCheckinHandlerFactory factory : VcsCheckinHandlerFactory.EP_NAME.getExtensionList()) {
    myVcsMap.putValue(factory.getKey(), factory);
  }
}
 
源代码16 项目: consulo   文件: CustomChangelistTodosTreeBuilder.java
public CustomChangelistTodosTreeBuilder(JTree tree, Project project, final String title, final Collection<? extends TodoItem> todoItems) {
  super(tree, project);
  myProject = project;
  myTitle = title;
  myMap = new MultiMap<>();
  myIncludedFiles = new HashSet<>();
  myChangeListManager = ChangeListManager.getInstance(myProject);
  initMap(todoItems);
  initHelper();
}
 
源代码17 项目: flutter-intellij   文件: AndroidUtils.java
@NotNull
@SuppressWarnings("DuplicatedCode")
private static Map<ProjectData, MultiMap<String, String>> getTasksMap(Project project) {
  Map<ProjectData, MultiMap<String, String>> tasks = new LinkedHashMap<>();
  for (GradleProjectSettings setting : GradleSettings.getInstance(project).getLinkedProjectsSettings()) {
    final ExternalProjectInfo projectData =
      ProjectDataManager.getInstance().getExternalProjectData(project, GradleConstants.SYSTEM_ID, setting.getExternalProjectPath());
    if (projectData == null || projectData.getExternalProjectStructure() == null) continue;

    MultiMap<String, String> projectTasks = MultiMap.createOrderedSet();
    for (DataNode<ModuleData> moduleDataNode : getChildren(projectData.getExternalProjectStructure(), ProjectKeys.MODULE)) {
      String gradlePath;
      String moduleId = moduleDataNode.getData().getId();
      if (moduleId.charAt(0) != ':') {
        int colonIndex = moduleId.indexOf(':');
        gradlePath = colonIndex > 0 ? moduleId.substring(colonIndex) : ":";
      }
      else {
        gradlePath = moduleId;
      }
      for (DataNode<TaskData> node : getChildren(moduleDataNode, ProjectKeys.TASK)) {
        TaskData taskData = node.getData();
        String taskName = taskData.getName();
        if (isNotEmpty(taskName)) {
          String taskPathPrefix = ":".equals(gradlePath) || taskName.startsWith(gradlePath) ? "" : (gradlePath + ':');
          projectTasks.putValue(taskPathPrefix, taskName);
        }
      }
    }
    tasks.put(projectData.getExternalProjectStructure().getData(), projectTasks);
  }
  return tasks;
}
 
源代码18 项目: consulo   文件: ComponentManagerImpl.java
protected void fillListenerDescriptors(MultiMap<String, PluginListenerDescriptor> mapByTopic) {
  for (PluginDescriptor plugin : PluginManager.getPlugins()) {
    if (!PluginManagerCore.shouldSkipPlugin(plugin)) {
      List<PluginListenerDescriptor> descriptors = getPluginListenerDescriptors(plugin);

      for (PluginListenerDescriptor descriptor : descriptors) {
        mapByTopic.putValue(descriptor.topicClassName, descriptor);
      }
    }
  }
}
 
源代码19 项目: consulo   文件: MacroFactory.java
private static MultiMap<String, Macro> init() {
  MultiMap<String, Macro> result = MultiMap.create();
  for(Macro macro: Extensions.getExtensions(Macro.EP_NAME)) {
    result.putValue(macro.getName(), macro);
  }
  return result;
}
 
源代码20 项目: intellij   文件: AndroidSyncTest.java
@Test
public void testSimpleSync_invalidSdkAndSReInstall() {
  TestProjectArguments testEnvArgument = createTestProjectArguments();
  MockSdkUtil.registerSdk(workspace, "28", "5", MultiMap.create(), true);
  setProjectView(
      "directories:",
      "  java/com/google",
      "targets:",
      "  //java/com/google:lib",
      "android_sdk_platform: android-28");
  setTargetMap(testEnvArgument.targetMap);
  // When IDE re-add local SDK into {link @ProjectJdkTable}, it need access to embedded jdk. Set
  // path to mock jdk as embedded jdk path to avoid NPE.
  Sdk jdk = IdeaTestUtil.getMockJdk18();
  File jdkFile = new File(jdk.getHomePath());
  if (!jdkFile.exists()) {
    jdkFile.mkdirs();
    jdkFile.deleteOnExit();
    TestUtils.setSystemProperties(
        getTestRootDisposable(), "android.test.embedded.jdk", jdkFile.getPath());
  }
  runBlazeSync(
      BlazeSyncParams.builder()
          .setTitle("Sync")
          .setSyncMode(SyncMode.INCREMENTAL)
          .setSyncOrigin("test")
          .setBlazeBuildParams(BlazeBuildParams.fromProject(getProject()))
          .setAddProjectViewTargets(true)
          .build());
  assertSyncSuccess(testEnvArgument.targetMap, testEnvArgument.javaRoot);
  assertThat(SdkUtil.containsJarAndRes(BlazeSdkProvider.getInstance().findSdk(ANDROID_28)))
      .isTrue();
}
 
源代码21 项目: consulo-unity3d   文件: Unity3dProjectImportUtil.java
private static Module createAssemblyCSharpModuleFirstPass(Project project,
														  ModifiableModuleModel newModel,
														  Sdk unityBundle,
														  MultiMap<Module, VirtualFile> virtualFilesByModule,
														  ProgressIndicator progressIndicator,
														  UnityProjectImportContext context)
{
	return createAndSetupModule("Assembly-CSharp-firstpass", project, newModel, FIRST_PASS_PATHS, unityBundle, null, "unity3d-csharp-child", CSharpFileType.INSTANCE, virtualFilesByModule,
			progressIndicator, context);
}
 
@RequiredReadAction
@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(@Nonnull VirtualFile file, @Nonnull FileEditor fileEditor)
{
	if(file.getFileType() != Unity3dYMLAssetFileType.INSTANCE || !ArrayUtil.contains(file.getExtension(), Unity3dAssetFileTypeDetector.ourAssetExtensions))
	{
		return null;
	}
	final String uuid = Unity3dAssetUtil.getGUID(myProject, file);
	if(uuid == null)
	{
		return null;
	}
	MultiMap<VirtualFile, Unity3dYMLAsset> map = Unity3dYMLAsset.findAssetAsAttach(myProject, file);
	if(map.isEmpty())
	{
		return null;
	}

	PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file);
	if(psiFile == null)
	{
		return null;
	}

	final EditorNotificationPanel panel = new EditorNotificationPanel();
	panel.text("Used asset...");
	panel.createActionLabel("Find usages...", () -> FindManager.getInstance(myProject).findUsages(psiFile));
	return panel;
}
 
源代码23 项目: consulo   文件: VcsDirtyScopeManagerImpl.java
@Nonnull
private MultiMap<AbstractVcs, FilePath> groupByVcs(@Nullable final Collection<FilePath> from) {
  if (from == null) return MultiMap.empty();
  MultiMap<AbstractVcs, FilePath> map = MultiMap.createSet();
  for (FilePath path : from) {
    AbstractVcs vcs = myGuess.getVcsForDirty(path);
    if (vcs != null) {
      map.putValue(vcs, path);
    }
  }
  return map;
}
 
源代码24 项目: consulo   文件: VcsDirtyScopeImpl.java
private void addFilePathToMap(MultiMap<VirtualFile, FileOrDir> perRoot, final FilePath dir, final boolean recursively) {
  VirtualFile vcsRoot = ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile>() {
    @Override
    public VirtualFile compute() {
      return myVcsManager.getVcsRootFor(dir);
    }
  });
  if (vcsRoot != null) {
    perRoot.putValue(vcsRoot, new FileOrDir(dir, recursively));
  }
}
 
源代码25 项目: consulo   文件: DesktopImportantFolderLocker.java
private static void addExistingPort(@Nonnull File portMarker, @Nonnull String path, @Nonnull MultiMap<Integer, String> portToPath) {
  if (portMarker.exists()) {
    try {
      portToPath.putValue(Integer.parseInt(FileUtilRt.loadFile(portMarker)), path);
    }
    catch (Exception e) {
      log(e);
      // don't delete - we overwrite it on write in any case
    }
  }
}
 
源代码26 项目: consulo   文件: ListTemplatesHandler.java
@RequiredUIAccess
@Override
public void invoke(@Nonnull final Project project, @Nonnull final Editor editor, @Nonnull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)) {
    return;
  }
  EditorUtil.fillVirtualSpaceUntilCaret(editor);

  PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
  int offset = editor.getCaretModel().getOffset();
  List<TemplateImpl> applicableTemplates = TemplateManagerImpl.listApplicableTemplateWithInsertingDummyIdentifier(editor, file, false);

  Map<TemplateImpl, String> matchingTemplates = filterTemplatesByPrefix(applicableTemplates, editor, offset, false, true);
  MultiMap<String, CustomLiveTemplateLookupElement> customTemplatesLookupElements = getCustomTemplatesLookupItems(editor, file, offset);

  if (matchingTemplates.isEmpty()) {
    for (TemplateImpl template : applicableTemplates) {
      matchingTemplates.put(template, null);
    }
  }

  if (matchingTemplates.isEmpty() && customTemplatesLookupElements.isEmpty()) {
    HintManager.getInstance().showErrorHint(editor, CodeInsightBundle.message("templates.no.defined"));
    return;
  }

  showTemplatesLookup(project, editor, file, matchingTemplates, customTemplatesLookupElements);
}
 
源代码27 项目: consulo   文件: DirtBuilder.java
public DirtBuilder(final VcsGuess guess) {
  myGuess = guess;
  myDirs = MultiMap.createSet();
  myFiles = MultiMap.createSet();
  myEverythingDirty = false;
  myFileTypeManager = FileTypeManager.getInstance();
}
 
源代码28 项目: consulo   文件: ApplyPatchDifferentiatedDialog.java
@RequiredUIAccess
private void runExecutor(ApplyPatchExecutor executor) {
  final Collection<AbstractFilePatchInProgress> included = getIncluded();
  if (included.isEmpty()) return;
  final MultiMap<VirtualFile, AbstractFilePatchInProgress> patchGroups = new MultiMap<>();
  for (AbstractFilePatchInProgress patchInProgress : included) {
    patchGroups.putValue(patchInProgress.getBase(), patchInProgress);
  }
  final LocalChangeList selected = getSelectedChangeList();
  FilePresentationModel presentation = myRecentPathFileChange.get();
  VirtualFile vf = presentation != null ? presentation.getVf() : null;
  executor.apply(getOriginalRemaining(), patchGroups, selected, vf == null ? null : vf.getName(),
                 myReader == null ? null : myReader.getAdditionalInfo(ApplyPatchDefaultExecutor.pathsFromGroups(patchGroups)));
}
 
源代码29 项目: consulo   文件: TriggerAdditionOrDeletion.java
private void processDeletion(SortByVcsRoots<FilePath> sortByVcsRoots) {
  final MultiMap<VcsRoot, FilePath> map = sortByVcsRoots.sort(myDeleted);
  myPreparedDeletion = new MultiMap<>();
  for (VcsRoot vcsRoot : map.keySet()) {
    if (vcsRoot != null && vcsRoot.getVcs() != null) {
      final CheckinEnvironment localChangesProvider = vcsRoot.getVcs().getCheckinEnvironment();
      if (localChangesProvider == null) continue;
      final boolean takeDirs = vcsRoot.getVcs().areDirectoriesVersionedItems();

      final Collection<FilePath> files = map.get(vcsRoot);
      final List<FilePath> toBeDeleted = new LinkedList<>();
      for (FilePath file : files) {
        final FilePath parent = file.getParentPath();
        if ((takeDirs || (! file.isDirectory())) && parent != null && parent.getIOFile().exists()) {
          toBeDeleted.add(file);
        }
      }
      if (toBeDeleted.isEmpty()) return;
      if (! vcsRoot.getVcs().fileListenerIsSynchronous()) {
        for (FilePath filePath : toBeDeleted) {
          myVcsFileListenerContextHelper.ignoreDeleted(filePath);
        }
      }
      myPreparedDeletion.put(vcsRoot, toBeDeleted);
    }
  }
}
 
源代码30 项目: intellij-haxe   文件: ExtractSuperClassUtil.java
private static void fireConflictsEvent(MultiMap<PsiElement, String> conflicts, Project project) {
  final RefactoringEventData conflictUsages = new RefactoringEventData();
  conflictUsages.putUserData(RefactoringEventData.CONFLICTS_KEY, conflicts.values());
  project.getMessageBus()
    .syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC)
    .conflictsDetected(REFACTORING_EXTRACT_SUPER_ID, conflictUsages);
}