mirror of
https://github.com/ilyakooo0/intellij-haskell.git
synced 2024-09-11 14:56:19 +03:00
Skip packages with subdirs which are referring to git(hub). Fix issue #379.
This commit is contained in:
parent
d199174683
commit
7e30c1e2f0
@ -195,7 +195,7 @@ object StackProjectManager {
|
||||
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.")
|
||||
HaskellNotificationGroup.warningEvent(project, s"Can not add package $p as module because it's absolute file path ${packagePath.getAbsolutePath} does not exist.")
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -30,6 +30,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
|
||||
import com.intellij.packaging.artifacts.ModifiableArtifactModel
|
||||
import com.intellij.projectImport.ProjectImportBuilder
|
||||
import icons.HaskellIcons
|
||||
import intellij.haskell.HaskellNotificationGroup
|
||||
import intellij.haskell.stackyaml.StackYamlComponent
|
||||
import intellij.haskell.util.{ApplicationUtil, HaskellFileUtil, HaskellProjectUtil, ScalaUtil}
|
||||
import javax.swing.Icon
|
||||
@ -91,10 +92,11 @@ object StackProjectImportBuilder {
|
||||
moduleBuilder.addModuleConfigurationUpdater((_: Module, rootModel: ModifiableRootModel) => {
|
||||
moduleBuilder.setupRootModel(rootModel)
|
||||
})
|
||||
case None => ()
|
||||
case None =>
|
||||
Messages.showInfoMessage(project, s"Can not add package $packageRelativePath as module because ${moduleDirectory.getAbsolutePath} does not contain Cabal file or Cabal file can not be parsed", "Adding module failed")
|
||||
}
|
||||
} else {
|
||||
Messages.showErrorDialog(s"Can not add package $packageRelativePath as module because it's absolute file path ${moduleDirectory.getAbsolutePath} does not exist.", "Module can not be created")
|
||||
Messages.showInfoMessage(project, s"Can not add package $packageRelativePath as module because it's absolute file path ${moduleDirectory.getAbsolutePath} does not exist.", "Adding module failed")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,12 @@ object StackYamlComponent {
|
||||
case s: String if isNotURL(s) => Seq(s)
|
||||
case m: util.Map[_, _] =>
|
||||
val map = m.asInstanceOf[util.Map[String, Any]].asScala.toMap
|
||||
getSubdirs(project, map).getOrElse(Seq()) ++ getLocation(project, map).toSeq
|
||||
val location = getLocation(project, map)
|
||||
if (location.isDefined) {
|
||||
getSubdirs(project, map).getOrElse(location.toSeq)
|
||||
} else {
|
||||
Seq()
|
||||
}
|
||||
case _ => Seq()
|
||||
}
|
||||
case _ => Seq()
|
||||
|
Loading…
Reference in New Issue
Block a user