@Override public UpdateCopyright createInstance(Project project, Module module, VirtualFile file, FileType base, CopyrightProfile options) { return new UpdatePsiFileCopyright(project, module, file, options) { @Override protected void scanFile() { final PsiElement firstChild = getFile().getFirstChild(); if (firstChild != null) { checkComments(firstChild, firstChild, true); } } @Override protected boolean accept() { return getFile().getLanguage() == SPILanguage.INSTANCE; } }; }
@Nullable @Override public Language getLanguage(@NotNull VirtualFile file, @NotNull Project project) { final Module moduleForPsiElement = ModuleUtilCore.findModuleForFile(file, project); if (moduleForPsiElement == null) { return null; } final VirtualFile parent = file.getParent(); if (parent != null && "services".equals(parent.getName())) { final VirtualFile gParent = parent.getParent(); if (gParent != null && SpecialDirUtil.META_INF.equals(gParent.getName())) { final List<VirtualFile> virtualFiles = SpecialDirUtil.collectSpecialDirs(moduleForPsiElement, SpecialDirUtil.META_INF); if(!virtualFiles.contains(gParent)) { return null; } for (Condition<VirtualFile> condition : VETO_EP_NAME.getExtensions()) { if (condition.value(file)) { return null; } } return SPILanguage.INSTANCE; } } return null; }
private SPIFileType() { super(SPILanguage.INSTANCE); }
public SPIFile(@NotNull FileViewProvider viewProvider) { super(viewProvider, SPILanguage.INSTANCE); }
public SPIElementType(@NotNull @NonNls String debugName) { super(debugName, SPILanguage.INSTANCE); }