Skip to content

Instantly share code, notes, and snippets.

@suhininalex
Created October 25, 2017 19:32
Show Gist options
  • Save suhininalex/5ef7fc08e6351dfd7cb3c426ad78dc4b to your computer and use it in GitHub Desktop.
Save suhininalex/5ef7fc08e6351dfd7cb3c426ad78dc4b to your computer and use it in GitHub Desktop.
private fun process(content: FileContent): Map<HashValue, TextRanges> {
Logger.log("[Indexing] ${content.psiFile.name}")
return content.psiFile
.findIndexableElements()
.flatMap { it.createHashFragments(content.file) }
.groupBy { it.hash }
.mapValues { (_, values) -> values.map { it.range } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment