mirror of
https://github.com/ilyakooo0/intellij-haskell.git
synced 2024-09-11 14:56:19 +03:00
Prevent error when file path to package does not exist (issue #379).
This commit is contained in:
parent
8776a53d29
commit
3b14e02304
@ -16,6 +16,8 @@
|
||||
|
||||
package intellij.haskell.external.component
|
||||
|
||||
import java.io.File
|
||||
|
||||
import com.intellij.openapi.actionSystem.ActionManager
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.components.ProjectComponent
|
||||
@ -192,7 +194,12 @@ object StackProjectManager {
|
||||
}
|
||||
|
||||
packagePathsToAdd.foreach(p => {
|
||||
StackProjectImportBuilder.addHaskellModule(project, p, projectPath)
|
||||
val packagePath = new File(projectPath, p)
|
||||
if (packagePath.exists()) {
|
||||
StackProjectImportBuilder.addHaskellModule(project, p, projectPath)
|
||||
} else {
|
||||
HaskellNotificationGroup.logErrorBalloonEvent(project, s"Can not add package $p as module because it's absolute file path ${packagePath.getAbsolutePath} does not exist.")
|
||||
}
|
||||
})
|
||||
|
||||
StackReplsManager.getReplsManager(project).map(_.moduleCabalInfos).foreach { moduleCabalInfos =>
|
||||
|
Loading…
Reference in New Issue
Block a user