Skip to content

Commit 793497c

Browse files
committed
[#64] When finding steps, extend scope to project libraries
1 parent 0792c83 commit 793497c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cucumber-scala/src/main/scala/com/github/vbmacher/intellij/cucumber/scala/ScCucumberExtension.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.github.vbmacher.intellij.cucumber.scala.steps.{ScStepDefinition, ScSt
77
import com.intellij.openapi.module.{Module, ModuleUtilCore}
88
import com.intellij.openapi.progress.ProgressManager
99
import com.intellij.openapi.vfs.VirtualFile
10-
import com.intellij.psi.search.GlobalSearchScope
10+
import com.intellij.psi.search.{GlobalSearchScope, ProjectScope}
1111
import com.intellij.psi.util.PsiTreeUtil
1212
import com.intellij.psi.{PsiElement, PsiFile, PsiManager}
1313
import com.intellij.util.indexing.FileBasedIndex
@@ -45,10 +45,13 @@ class ScCucumberExtension extends AbstractCucumberExtension {
4545

4646
override def loadStepsFor(featureFile: PsiFile, module: Module): java.util.List[AbstractStepDefinition] = {
4747
val fileBasedIndex = FileBasedIndex.getInstance()
48-
val searchScope = module.getModuleWithDependenciesAndLibrariesScope(true)
49-
val scalaFiles = GlobalSearchScope.getScopeRestrictedByFileTypes(searchScope, ScalaFileType.INSTANCE)
5048
val project = module.getProject
5149

50+
val searchScope = module
51+
.getModuleWithDependenciesAndLibrariesScope(true)
52+
.uniteWith(ProjectScope.getLibrariesScope(project))
53+
val scalaFiles = GlobalSearchScope.getScopeRestrictedByFileTypes(searchScope, ScalaFileType.INSTANCE)
54+
5255
val result = collection.mutable.Buffer.empty[AbstractStepDefinition]
5356

5457
fileBasedIndex.processValues(ScCucumberStepIndex.INDEX_ID, java.lang.Boolean.TRUE, null, {

0 commit comments

Comments
 (0)