Skip to content

Instantly share code, notes, and snippets.

@johnnykang
Created December 22, 2016 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnnykang/eed464578e33f03cdc1b0d06c19c00e4 to your computer and use it in GitHub Desktop.
Save johnnykang/eed464578e33f03cdc1b0d06c19c00e4 to your computer and use it in GitHub Desktop.
index weaver
@Around("execution(* com.intellij.util.indexing.FileBasedIndexImpl.a(com.intellij.openapi.vfs.VirtualFile, com.intellij.util.indexing.ID<?,?>))")
public Object advice(ProceedingJoinPoint joinPoint) throws Throwable {
VirtualFile o = (VirtualFile) joinPoint.getArgs()[0];
VirtualFileSystem fileSystem = o.getFileSystem();
if (JarFileSystem.class.isAssignableFrom(fileSystem.getClass())) {
File file = VfsImplUtil.getHandler((JarFileSystemImpl) fileSystem, o, JarHandler::new).getFile();
for (Pattern s : skip) {
if (s.matcher(file.getName()).matches()) {
// System.out.println("bye bye ::" + file);
return false;
}
}
}
return joinPoint.proceed();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment