private void registerFileTypeWithoutNotification(@NotNull FileType newFileType,
                                                   @NotNull PluginDescriptor newPluginDescriptor,
                                                   @NotNull List<? extends FileNameMatcher> newMatchers,
                                                   @NotNull PluginAdvertiserExtensionsStateService pluginAdvertiserExtensionsStateService,
                                                   boolean addScheme) {
    FileTypeWithDescriptor newFtd = new FileTypeWithDescriptor(newFileType, newPluginDescriptor);
    if (addScheme) {
      FileTypeWithDescriptor oldFileType = schemeManager.findSchemeByName(newFileType.getName());
      if (oldFileType != null) {
        if (!(oldFileType.fileType() instanceof AbstractFileType)) {
          throw new IllegalArgumentException(newFileType + " already registered");
        }
        removeFromDuplicates(oldFileType.fileType(), oldFileType.pluginDescriptor());
      }
      schemeManager.addScheme(newFtd);
      pendingFileTypes.remove(newFileType.getName());
      pendingAssociations.removeAllAssociations(bean -> bean.name.equals(newFileType.getName()));
      checkFileTypeNamesUniqueness(newFtd);
    }
    List<FileNameMatcher> mappingsRemovedFromNew = removedMappingTracker.getMappingsForFileType(newFileType.getName());
    for (FileNameMatcher newMatcher : newMatchers) {
      if (mappingsRemovedFromNew.contains(newMatcher)) {
        continue;
      }

      FileTypeWithDescriptor oldFtd = patternsTable.findAssociatedFileType(newMatcher);
      List<FileNameMatcher> mappingsRemovedFromOld = oldFtd == null ? Collections.emptyList() : removedMappingTracker.getMappingsForFileType(oldFtd.getName());
      ConflictingFileTypeMappingTracker.ResolveConflictResult result;
      if (mappingsRemovedFromOld.contains(newMatcher)) {
        // no conflict really, new file type wins because removedMapping explicitly said "remove newMatcher from old file type"
        result = new ConflictingFileTypeMappingTracker.ResolveConflictResult(newFtd, "", "", true);
      }
      else {
        result = conflictingMappingTracker.warnAndResolveConflict(newMatcher, oldFtd, newFtd);
        if (oldFtd != null) {
          LOG.debug(newMatcher + " had a conflict between " + oldFtd + " and " + newFtd + " and the winner is ... ... ... " + result);
        }
      }
      if (!result.approved() && conflictResultConsumer != null) {
        conflictResultConsumer.accept(result);
      }
      FileTypeWithDescriptor resolvedFtd = result.resolved();
      FileType oldFileType = oldFtd == null ? null : oldFtd.fileType();
      if (!resolvedFtd.equals(oldFtd)) {
        patternsTable.addAssociation(newMatcher, resolvedFtd);
        if (result.approved() && oldFileType != null) {
          removedMappingTracker.add(newMatcher, oldFileType.getName(), true);
        }
      }
      else if (oldFileType instanceof AbstractFileType && result.approved()) {
        patternsTable.addAssociation(newMatcher, newFtd);
      }

      initialAssociations.addAssociation(newMatcher, newFileType);
    }

    if (newFileType instanceof FileTypeIdentifiableByVirtualFile) {
      specialFileTypes = ArrayUtil.append(specialFileTypes, (FileTypeIdentifiableByVirtualFile)newFileType, FileTypeIdentifiableByVirtualFile.ARRAY_FACTORY);
    }

    pluginAdvertiserExtensionsStateService.registerLocalPlugin(newMatchers, newPluginDescriptor);
  }
private void registerFileTypeWithoutNotification(@NotNull FileType newFileType,
                                                   @NotNull PluginDescriptor newPluginDescriptor,
                                                   @NotNull List<? extends FileNameMatcher> newMatchers,
                                                   @NotNull PluginAdvertiserExtensionsStateService pluginAdvertiserExtensionsStateService,
                                                   boolean addScheme)