From 1b554b8e7a5ae0a558b7a67a3037716673b5f4b2 Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Wed, 3 Jan 2024 13:52:33 +0100 Subject: [PATCH] Fix source file name on Windows --- tasty-query/shared/src/main/scala/tastyquery/SourceFile.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasty-query/shared/src/main/scala/tastyquery/SourceFile.scala b/tasty-query/shared/src/main/scala/tastyquery/SourceFile.scala index 4985dcac..9d001b47 100644 --- a/tasty-query/shared/src/main/scala/tastyquery/SourceFile.scala +++ b/tasty-query/shared/src/main/scala/tastyquery/SourceFile.scala @@ -1,13 +1,14 @@ package tastyquery import java.util.Arrays +import java.io.File final class SourceFile private[tastyquery] (_path: String): /** The full, though usually relative, path of the file, as stored in TASTy. */ def path: String = _path /** The last `/`-separated component of the `path`. */ - def name: String = path.substring(path.lastIndexOf('/') + 1).nn + def name: String = path.substring(path.lastIndexOf(File.separatorChar) + 1).nn override def toString(): String = path