diff --git a/mtags/src/main/scala/scala/meta/internal/mtags/Semanticdbs.scala b/mtags/src/main/scala/scala/meta/internal/mtags/Semanticdbs.scala index 8ec3da4a96c..e7822d4cae9 100644 --- a/mtags/src/main/scala/scala/meta/internal/mtags/Semanticdbs.scala +++ b/mtags/src/main/scala/scala/meta/internal/mtags/Semanticdbs.scala @@ -66,7 +66,7 @@ object Semanticdbs { val sdocs = loadTextDocuments(semanticdbPath) sdocs.documents.find(_.uri.replace("\\", "/") == reluri) match { case None => TextDocumentLookup.NoMatchingUri(scalaPath, sdocs) - case Some(sdoc) => + case Some(sdoc) if scalaPath.exists => val text = FileIO.slurp(scalaPath, charset) val md5 = MD5.compute(text) val sdocMd5 = sdoc.md5.toUpperCase() @@ -81,6 +81,7 @@ object Semanticdbs { } else { TextDocumentLookup.Success(sdoc.withText(text)) } + case _ => TextDocumentLookup.NotFound(scalaPath) } } def printTextDocument(doc: s.TextDocument): String = {