mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Allow specifying patterns when registering file types in plugin.xml (IDEA-CR-47980)
GitOrigin-RevId: afc1dd7844ba0c7f03a64a234bdd99fde786f4a9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
81021332bc
commit
66488e1a18
@@ -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.
|
||||
*/
|
||||
|
||||
+6
-3
@@ -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<FileTypeBean> 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) {
|
||||
|
||||
Reference in New Issue
Block a user