nimsuggest: crash when analyzing code with generic closures
### Description

Using the `vscode-nim` extension (version 1.2) with the language server (version 1.6), the `nimsuggest` extension crashes when analyzing specific Nim code. The code is valid and compiles without errors.

Minimal reproducible example:
```nim
import sugar

type
    Parser[T] = object
    
proc eatWhile[T](p: Parser[T], predicate: T -> bool): seq[T] =
    return @[]

proc skipWs(p: Parser[char]) =
    discard p.eatWhile((c: char) => c == 'a')
```

### Nim Version

Nim Compiler Version 2.0.8 [Windows: amd64]
Compiled at 2024-07-03

### Current Output

```text
Server failed with lineinfos.nim(318)     raise RecoverableError
Error: unhandled exception: fatal error: command expects a filename [ERecoverableError]
```


### Expected Output

_No response_

### Known Workarounds

_No response_

### Additional Information

_No response_