Skip to content

Commit

Permalink
Ignore results outside of project
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD committed Jul 26, 2023
1 parent 39f7fef commit 06cb58e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ abstract class ApolloMigrationRefactoringProcessor(project: Project) : BaseRefac
val usageInfos = migrationItems
.flatMap { migrationItem ->
migrationItem.findUsages(myProject, migration!!, searchScope)
.filterNot { usageInfo ->
.filter { usageInfo ->
// Filter out all generated code usages. We don't want generated code to come up in findUsages.
// TODO: how to mark Apollo generated code as generated per this method?
usageInfo.virtualFile?.isGenerated(myProject) == true
usageInfo.virtualFile?.isGenerated(myProject) != true //&&

// Also filter out usages outside of projects (see https://youtrack.jetbrains.com/issue/KTIJ-26411)
usageInfo.virtualFile?.let { searchScope.contains(it) } == true
}
}
.toMutableList()
Expand Down

0 comments on commit 06cb58e

Please sign in to comment.