diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeBean.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeBean.java index fb8b559e247b..62b6f21cccfc 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeBean.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeBean.java @@ -50,6 +50,12 @@ public class FileTypeBean extends AbstractExtensionPointBean { @Attribute("fileNames") public String fileNames; + /** + * Semicolon-separated list of patterns (strings containing ? and * characters) to be associated with the file type. + */ + @Attribute("patterns") + public String patterns; + /** * Semicolon-separated list of exact file names (case insensitive) to be associated with the file type. */ diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java index 701958a3fab1..373967a95a74 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java @@ -61,6 +61,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; import org.jetbrains.ide.PooledThreadExecutor; +import org.jetbrains.jps.model.fileTypes.FileNameMatcherFactory; import java.io.*; import java.lang.reflect.Field; @@ -351,9 +352,11 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent final List fileTypeBeans = EP_NAME.getExtensionList(); for (FileTypeBean bean : fileTypeBeans) { - bean.addMatchers(ContainerUtil.concat(parse(bean.extensions), - parse(bean.fileNames, (token) -> new ExactFileNameMatcher(token)), - parse(bean.fileNamesCaseInsensitive, (token) -> new ExactFileNameMatcher(token, true)))); + bean.addMatchers(ContainerUtil.concat( + parse(bean.extensions), + parse(bean.fileNames, (token) -> new ExactFileNameMatcher(token)), + parse(bean.fileNamesCaseInsensitive, (token) -> new ExactFileNameMatcher(token, true)), + parse(bean.patterns, (token) -> FileNameMatcherFactory.getInstance().createMatcher(token)))); } for (FileTypeBean bean : fileTypeBeans) {