Repository: scalameta/scalameta (scala)
Issue: Metals show error on operators in beginning of the line
### Describe the bug

Error:

![image](https://user-images.githubusercontent.com/20382/213281075-131f01f5-faa0-46d8-b5f2-0efb8a203e3c.png)

Sample code:

```scala
  // This works:
  val httpRoutes = (MetricsApp() ++ HomeApp() ++ GreetingApp()) @@
    Middleware.cors(corsConfig) @@
    Middleware.metrics(MetricsApp.pathLabelMapper) @@
    Middleware.debug

  // This shows error:
  val httpRoutes2 = (MetricsApp() ++ HomeApp() ++ GreetingApp())
    @@ Middleware.cors(corsConfig)
    @@ Middleware.metrics(MetricsApp.pathLabelMapper)
    @@ Middleware.debug
```

Both cases compile and run fine.

### Expected behavior

No error shown in the second sample.

### Operating system

macOS

### Editor/Extension

VS Code

### Version of Metals

0.11.10+56-1cbc85ca-SNAPSHOT

### Extra context or search terms

_No response_
Pull request description: Fixes #3051.

Patch:
diff --git a/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScannerTokens.scala b/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScannerTokens.scala
index b97c63c9f2..35ffbbfbbd 100644
--- a/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScannerTokens.scala
+++ b/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScannerTokens.scala
@@ -70,7 +70,7 @@ final class ScannerTokens(val tokens: Tokens)(implicit dialect: Dialect) {
       }
 
       val len = text.length
-      len == 0 || (text(0) != '@' && iter(len - 1, false))
+      len == 0 || iter(len - 1, false)
     }
   }
 


Test patch:
diff --git a/tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/InfixSuite.scala b/tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/InfixSuite.scala
index ca10dabc33..f74c53de15 100644
--- a/tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/InfixSuite.scala
+++ b/tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/InfixSuite.scala
@@ -551,4 +551,56 @@ class InfixSuite extends BaseDottySuite {
     )
   }
 
+  test("#3051 scala3 leading infix syntax") {
+    runTestAssert[Stat](
+      """|val httpRoutes2 = (MetricsApp() ++ HomeApp() ++ GreetingApp())
+         |      @@ Middleware.cors(corsConfig)
+         |      @@ Middleware.metrics(MetricsApp.pathLabelMapper)
+         |      @@ Middleware.debug
+         |""".stripMargin,
+      Some(
+        """|val httpRoutes2 = (MetricsApp() ++ HomeApp() ++ GreetingApp()) @@ Middleware.cors(corsConfig) @@ Middleware.metrics(MetricsApp.pathLabelMapper) @@ Middleware.debug
+           |""".stripMargin
+      )
+    )(
+      Defn.Val(
+        Nil,
+        List(Pat.Var(tname("httpRoutes2"))),
+        None,
+        Term.ApplyInfix(
+          Term.ApplyInfix(
+            Term.ApplyInfix(
+              Term.ApplyInfix(
+                Term.ApplyInfix(
+                  Term.Apply(tname("MetricsApp"), Nil),
+                  tname("++"),
+                  Nil,
+                  List(Term.Apply(tname("HomeApp"), Nil))
+                ),
+                tname("++"),
+                Nil,
+                List(Term.Apply(tname("GreetingApp"), Nil))
+              ),
+              tname("@@"),
+              Nil,
+              Term.Apply(
+                Term.Select(tname("Middleware"), tname("cors")),
+                List(tname("corsConfig"))
+              ) :: Nil
+            ),
+            tname("@@"),
+            Nil,
+            Term.Apply(
+              Term.Select(tname("Middleware"), tname("metrics")),
+              List(Term.Select(tname("MetricsApp"), tname("pathLabelMapper")))
+            ) :: Nil
+          ),
+          tname("@@"),
+          Nil,
+          List(Term.Select(tname("Middleware"), tname("debug")))
+        )
+      )
+    )
+  }
+
 }