mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove CommunityFileTypes.xml
This commit is contained in:
File diff suppressed because one or more lines are too long
+4
-18
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.fileTypes.impl;
|
||||
|
||||
import com.intellij.ide.highlighter.FileTypeRegistrator;
|
||||
@@ -316,14 +302,14 @@ public class AbstractFileType extends UserFileType<AbstractFileType> implements
|
||||
return !Comparing.equal(myDefaultSyntaxTable, getSyntaxTable());
|
||||
}
|
||||
|
||||
@NonNls private static final String ELEMENT_MAPPING = "mapping";
|
||||
@NonNls private static final String ATTRIBUTE_EXT = "ext";
|
||||
@NonNls static final String ELEMENT_MAPPING = "mapping";
|
||||
@NonNls static final String ATTRIBUTE_EXT = "ext";
|
||||
@NonNls private static final String ATTRIBUTE_PATTERN = "pattern";
|
||||
/** Applied for removed mappings approved by user */
|
||||
@NonNls private static final String ATTRIBUTE_APPROVED = "approved";
|
||||
|
||||
@NonNls private static final String ELEMENT_REMOVED_MAPPING = "removed_mapping";
|
||||
@NonNls private static final String ATTRIBUTE_TYPE = "type";
|
||||
@NonNls static final String ATTRIBUTE_TYPE = "type";
|
||||
|
||||
@NotNull
|
||||
public static List<Pair<FileNameMatcher, String>> readAssociations(@NotNull Element element) {
|
||||
|
||||
+19
-6
@@ -67,6 +67,8 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import static com.intellij.openapi.fileTypes.impl.AbstractFileType.*;
|
||||
|
||||
@State(name = "FileTypeManager", storages = @Storage("filetypes.xml"), additionalExportFile = FileTypeManagerImpl.FILE_SPEC )
|
||||
public class FileTypeManagerImpl extends FileTypeManagerEx implements PersistentStateComponent<Element>, Disposable, ApplicationComponent {
|
||||
private static final Logger LOG = Logger.getInstance(FileTypeManagerImpl.class);
|
||||
@@ -191,7 +193,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
|
||||
fileType.writeExternal(root);
|
||||
|
||||
Element map = new Element(AbstractFileType.ELEMENT_EXTENSION_MAP);
|
||||
Element map = new Element(ELEMENT_EXTENSION_MAP);
|
||||
writeExtensionsMap(map, fileType, false);
|
||||
if (!map.getChildren().isEmpty()) {
|
||||
root.addContent(map);
|
||||
@@ -311,16 +313,27 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
if (defaultFileTypesUrl != null) {
|
||||
Element defaultFileTypesElement = JdomKt.loadElement(URLUtil.openStream(defaultFileTypesUrl));
|
||||
for (Element e : defaultFileTypesElement.getChildren()) {
|
||||
//noinspection SpellCheckingInspection
|
||||
if ("filetypes".equals(e.getName())) {
|
||||
for (Element element : e.getChildren(ELEMENT_FILETYPE)) {
|
||||
loadFileType(element, true);
|
||||
}
|
||||
}
|
||||
else if (AbstractFileType.ELEMENT_EXTENSION_MAP.equals(e.getName())) {
|
||||
else if (ELEMENT_EXTENSION_MAP.equals(e.getName())) {
|
||||
readGlobalMappings(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (PlatformUtils.isIdeaCommunity()) {
|
||||
Element extensionMap = new Element(ELEMENT_EXTENSION_MAP);
|
||||
extensionMap.addContent(new Element(ELEMENT_MAPPING)
|
||||
.setAttribute(ATTRIBUTE_EXT, "jspx")
|
||||
.setAttribute(ATTRIBUTE_TYPE, "XML"));
|
||||
//noinspection SpellCheckingInspection
|
||||
extensionMap.addContent(new Element(ELEMENT_MAPPING)
|
||||
.setAttribute(ATTRIBUTE_EXT, "tagx")
|
||||
.setAttribute(ATTRIBUTE_TYPE, "XML"));
|
||||
readGlobalMappings(extensionMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
@@ -1087,7 +1100,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
if (element.getName().equals(ELEMENT_IGNORE_FILES)) {
|
||||
myIgnoredPatterns.setIgnoreMasks(element.getAttributeValue(ATTRIBUTE_LIST));
|
||||
}
|
||||
else if (AbstractFileType.ELEMENT_EXTENSION_MAP.equals(element.getName())) {
|
||||
else if (ELEMENT_EXTENSION_MAP.equals(element.getName())) {
|
||||
readGlobalMappings(element);
|
||||
}
|
||||
}
|
||||
@@ -1244,7 +1257,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
state.addContent(new Element(ELEMENT_IGNORE_FILES).setAttribute(ATTRIBUTE_LIST, ignoreFiles));
|
||||
}
|
||||
|
||||
Element map = new Element(AbstractFileType.ELEMENT_EXTENSION_MAP);
|
||||
Element map = new Element(ELEMENT_EXTENSION_MAP);
|
||||
|
||||
List<FileType> notExternalizableFileTypes = new ArrayList<>();
|
||||
for (FileType type : mySchemeManager.getAllSchemes()) {
|
||||
@@ -1414,7 +1427,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
}
|
||||
}
|
||||
else {
|
||||
Element extensions = typeElement.getChild(AbstractFileType.ELEMENT_EXTENSION_MAP);
|
||||
Element extensions = typeElement.getChild(ELEMENT_EXTENSION_MAP);
|
||||
if (extensions != null) {
|
||||
for (Pair<FileNameMatcher, String> association : AbstractFileType.readAssociations(extensions)) {
|
||||
associate(type, association.getFirst(), false);
|
||||
|
||||
Reference in New Issue
Block a user