Self (final @NotNull ElementPattern<? extends VirtualFile> filePattern) { return with(new PatternCondition<T>("inVirtualFile") { @Override public boolean accepts(final @NotNull T t, final ProcessingContext context) { return filePattern.accepts(t.getContainingFile().getViewProvider().getVirtualFile(), context); } }); }