Skip to content

Commit 9365da3

Browse files
committed
chore(dependencies): add dependency collection for Go projects #316
1 parent 76e0329 commit 9365da3

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

goland/src/main/kotlin/cc/unitmesh/go/provider/GoBuildSystemProvider.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ class GoBuildSystemProvider : BuildSystemProvider() {
2929
.toList()
3030
}
3131

32-
3332
fun getAllModules(project: Project): Iterable<DevModuleModel> {
3433
val result = mutableListOf<DevModuleModel>()
35-
3634
ModuleManager.getInstance(project).modules.forEach { module ->
3735
ProgressManager.checkCanceled()
3836
VgoModulesRegistry.getInstance(project).getModules(module).forEach { vgoModule ->

goland/src/main/kotlin/cc/unitmesh/go/provider/testing/GoAutoTestService.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ import com.intellij.psi.util.PsiTreeUtil
2525
import com.intellij.testIntegration.TestFinderHelper
2626

2727
class GoAutoTestService : AutoTestService() {
28-
override fun isApplicable(element: PsiElement): Boolean = element.containingFile?.language == GoLanguage.INSTANCE
29-
override fun isApplicable(project: Project, file: VirtualFile): Boolean {
30-
return file.extension == "go"
31-
}
28+
override fun isApplicable(element: PsiElement) = element.containingFile?.language == GoLanguage.INSTANCE
29+
override fun isApplicable(project: Project, file: VirtualFile) = file.extension == "go"
3230

3331
override fun runConfigurationClass(project: Project): Class<out RunProfile> = GoTestRunConfiguration::class.java
3432
override fun lookupRelevantClass(project: Project, element: PsiElement): List<ClassContext> = listOf()

pycharm/src/main/kotlin/cc/unitmesh/python/provider/PythonBuildSystemProvider.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ class PythonBuildSystemProvider : BuildSystemProvider() {
1212
override fun collect(project: Project): DockerfileContext? = null
1313

1414
override fun collectDependencies(project: Project, psiFile: PsiFile): List<DevPackage> {
15-
if (psiFile.language.id != "Python") {
16-
return emptyList()
17-
}
15+
if (psiFile.language.id != "Python") return emptyList()
1816

1917
val reqs: List<PyRequirement> = PyRequirementParser.fromFile(psiFile.virtualFile)
2018

2119
return reqs.map {
2220
DevPackage(
23-
type = "Python",
21+
type = "pypi",
2422
name = it.name,
2523
version = it.versionSpecs.firstOrNull()?.version ?: ""
2624
)

0 commit comments

Comments
 (0)