Skip to content

Commit

Permalink
Merge pull request #1516 from tpasternak/always-open-intellij-in-root…
Browse files Browse the repository at this point in the history
…-dir

Always launch IntelliJ in the project's root directory
  • Loading branch information
olafurpg authored Mar 19, 2020
2 parents 0bc676d + 1b119fe commit cd5f338
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,7 @@ object IntelliJ {
List("idea")
}
}
val hasIdeaDirectory = project.bspRoot.resolve(".idea").isDirectory
val openDirectory =
// NOTE(olafur): it seems necessary to use the parent directory when there
// is an existing .idea/ directory. This behavior was discovered by trial
// and error. If we don't use the parent directory when there is an
// existing idea/ directory then IntelliJ opens the project as a normal
// directory without BSP (even if there is a .bsp/ directory).
if (hasIdeaDirectory) project.parentRoot
else project.bspRoot
val openDirectory = project.bspRoot
val exit = Process(
command ++ List(openDirectory.toString),
cwd = Some(openDirectory.toFile)
Expand Down

0 comments on commit cd5f338

Please sign in to comment.