Java 类com.intellij.lang.spi.SPILanguage 实例源码

项目:intellij-ce-playground    文件:UpdateSPIFileCopyright.java   
@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;
    }
  };
}
项目:tools-idea    文件:UpdateSPIFileCopyright.java   
@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;
    }
  };
}
项目:consulo-java    文件:SPILanguageSubstitutor.java   
@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;
}
项目:intellij-ce-playground    文件:SPIFileType.java   
private SPIFileType() {
  super(SPILanguage.INSTANCE);
}
项目:intellij-ce-playground    文件:SPIFile.java   
public SPIFile(@NotNull FileViewProvider viewProvider) {
  super(viewProvider, SPILanguage.INSTANCE);
}
项目:intellij-ce-playground    文件:SPIElementType.java   
public SPIElementType(@NotNull @NonNls String debugName) {
  super(debugName, SPILanguage.INSTANCE);
}
项目:tools-idea    文件:SPIFileType.java   
private SPIFileType() {
  super(SPILanguage.INSTANCE);
}
项目:tools-idea    文件:SPIFile.java   
public SPIFile(@NotNull FileViewProvider viewProvider) {
  super(viewProvider, SPILanguage.INSTANCE);
}
项目:tools-idea    文件:SPIElementType.java   
public SPIElementType(@NotNull @NonNls String debugName) {
  super(debugName, SPILanguage.INSTANCE);
}
项目:consulo-java    文件:SPIFileType.java   
private SPIFileType() {
  super(SPILanguage.INSTANCE);
}
项目:consulo-java    文件:SPIFile.java   
public SPIFile(@NotNull FileViewProvider viewProvider) {
  super(viewProvider, SPILanguage.INSTANCE);
}
项目:consulo-java    文件:SPIElementType.java   
public SPIElementType(@NotNull @NonNls String debugName) {
  super(debugName, SPILanguage.INSTANCE);
}