Repository: effekt-lang/effekt (scala)

Issue:
Spurios `Exception` document symbols with empty range
Open the following Effekt program using the VSCode extension:

```scala 
def main() = { println("Hello, Effekt!") }
```

Notice that the outline is filled with unhelpful `Exception` symbols. They arrive as part of the `documentSymbol` response:

```json
  {
    "name": "Exception",
    "kind": 13,
    "range": {
      "start": {
        "line": 0,
        "character": 0
      },
      "end": {
        "line": 0,
        "character": 0
      }
    },
    "selectionRange": {
      "start": {
        "line": 0,
        "character": 0
      },
      "end": {
        "line": 0,
        "character": 0
      }
    },
    "detail": "Block parameter"
  },
```

Pull request:
During `ExplicitCapabilities`, we asssign some symbols for the explicitly passed capabilities (as additional block params).
It might be interesting to add spans to them in the future and maybe even show them as (optional) inlay hints for educational purposes. However, in this PR, I just hide them from the list of document symbols for now, which has previously been cluttered by them.

Resolves #895.
Depends on #1097.

Patch:
diff --git a/effekt/jvm/src/main/scala/effekt/Server.scala b/effekt/jvm/src/main/scala/effekt/Server.scala
index ae4322629..1ce820937 100644
--- a/effekt/jvm/src/main/scala/effekt/Server.scala
+++ b/effekt/jvm/src/main/scala/effekt/Server.scala
@@ -5,7 +5,7 @@ import effekt.Intelligence.CaptureInfo
 import effekt.context.Context
 import effekt.source.Def.FunDef
 import effekt.source.Term.Hole
-import effekt.source.{Span, Tree}
+import effekt.source.{Origin, Span, Tree}
 import effekt.symbols.Binder.{ValBinder, VarBinder}
 import effekt.symbols.BlockTypeConstructor.{ExternInterface, Interface}
 import effekt.symbols.TypeConstructor.{DataType, ExternType}
@@ -289,10 +289,10 @@ class Server(config: EffektConfig, compileOnChange: Boolean=false) extends Langu
       decl <- getSourceTreeFor(sym)
       kind <- getSymbolKind(sym)
       detail <- getInfoOf(sym)(using context)
+      if decl.span.origin != Origin.Missing
       declRange = convertRange(decl.span.range)
       idRange = convertRange(id.span.range)
     } yield new DocumentSymbol(sym.name.name, kind, declRange, idRange, detail.header)
-
     val result = Collections.seqToJavaList(
       documentSymbols.map(sym => messages.Either.forRight[SymbolInformation, DocumentSymbol](sym))
     )


Test patch:
diff --git a/effekt/jvm/src/test/scala/effekt/LSPTests.scala b/effekt/jvm/src/test/scala/effekt/LSPTests.scala
index 5b4c90def..c5b25193f 100644
--- a/effekt/jvm/src/test/scala/effekt/LSPTests.scala
+++ b/effekt/jvm/src/test/scala/effekt/LSPTests.scala
@@ -625,14 +625,8 @@ class LSPTests extends FunSuite {
 
       val params = new DocumentSymbolParams()
       params.setTextDocument(textDoc.versionedTextDocumentIdentifier)
-
-      val documentSymbols = server.getTextDocumentService().documentSymbol(params).get()
-      // FIXME: The server currently returns spurious symbols at position (0, 0) that we need to filter out.
-      val filtered = server.getTextDocumentService().documentSymbol(params).get().asScala.filter {
-        symbol => symbol.getRight.getRange.getStart != new Position(0, 0) && symbol.getRight.getRange.getEnd != new Position(0, 0)
-      }.asJava
-
-      assertEquals(filtered, expectedSymbols.asJava)
+      val actualSymbols = server.getTextDocumentService().documentSymbol(params).get()
+      assertEquals(actualSymbols, expectedSymbols.asJava)
     }
   }