Skip to content

Instantly share code, notes, and snippets.

@suhininalex
Created October 25, 2017 19:32
Show Gist options
  • Save suhininalex/e261762a3d70ec01b1bdbb3cc8c92068 to your computer and use it in GitHub Desktop.
Save suhininalex/e261762a3d70ec01b1bdbb3cc8c92068 to your computer and use it in GitHub Desktop.
fun findTextRanges(project: Project, hash: HashValue): List<FileTextRange> {
return FileBasedIndex.getInstance()
.getValuesWithFiles(NAME, hash, GlobalSearchScope.projectScope(project))
.flatMap { (file, ranges) -> ranges.map { FileTextRange(file, it) } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment