diff --git a/metals/src/main/scala/scala/meta/internal/parsing/Trees.scala b/metals/src/main/scala/scala/meta/internal/parsing/Trees.scala index ca515301deb..18b5192ca3f 100644 --- a/metals/src/main/scala/scala/meta/internal/parsing/Trees.scala +++ b/metals/src/main/scala/scala/meta/internal/parsing/Trees.scala @@ -174,7 +174,7 @@ final class Trees( val skipFistShebang = if (text.startsWith("#!")) text.replaceFirst("#!", "//") else text val input = Input.VirtualFile(path.toURI.toString(), skipFistShebang) - if (path.isAmmoniteScript) { + if (path.isAmmoniteScript || path.isMill) { val ammoniteInput = Input.Ammonite(input) ammoniteInput.safeParse[MultiSource](dialect) } else {