Skip to content

Commit

Permalink
bugfix: Don't use cache directory with null in it's path
Browse files Browse the repository at this point in the history
This is a bug in ProjectDirectories, which seems to be super hard to fix, so instead we can special case it. This is not super important to use that directory anyway, we fall back to local workspace.

Fixes scalameta#5590
  • Loading branch information
tgodzik committed Aug 28, 2023
1 parent e896373 commit e4fd860
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions metals/src/main/scala/scala/meta/internal/metals/Trace.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ object Trace {
// the path making it difficult to tail/cat from the terminal and cmd+click from VS Code.
// Instead, we use the `cacheDir` which has no spaces. The logs are safe to remove so
// putting them in the "cache directory" makes more sense compared to the "config directory".
AbsolutePath(projectDirectories.cacheDir)
}.toOption
val cacheDir = projectDirectories.cacheDir
// deal with issue on windows and PowerShell, which would cause us to create a null directory in the workspace
if (cacheDir.startsWith("null/"))
None
else Some(AbsolutePath(cacheDir))
}.toOption.flatten

private val localDirectory: AbsolutePath =
PathIO.workingDirectory.resolve(".metals/")
Expand Down

0 comments on commit e4fd860

Please sign in to comment.