Beaglefoot / awk-language-server

Language Server for AWK and associated VSCode client extension
https://marketplace.visualstudio.com/items?itemName=beaglefoot.awk-ide-vscode
MIT License
90 stars 5 forks source link

RangeError: Maximum call stack size exceeded #55

Open nverno opened 9 months ago

nverno commented 9 months ago

Hi, I'm trying to run the language server using emacs' lsp-mode, but the server is crashing shortly after starting with the following stderr output:

Language Server is started. node:internal/fs/utils:248 function getDirents(path, { 0: names, 1: types }, callback) { ^

RangeError: Maximum call stack size exceeded at getDirents (node:internal/fs/utils:248:20) at readdirSync (node:fs:1551:34) RangeError: Maximum call stack size exceeded at getAwkFilesInDir (<...>/nodejs/20.7.0/lib/node_modules/awk-language-server/out/io.js:22:26)

Same thing with node versions v18.5.0 and v20.7.0.

Tracing the calls from lsp-mode to the awk language server, it appears that emacs is receiving a request for 'workspace/workspaceFolders', then sending its response 'workspace/workspaceFolders' with params:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "uri": "file:///..."
        },
        etc...
    ]
}

At which point the error happens. Do you know why this might be? A problem on the lsp-mode side or with the language server?

nverno commented 9 months ago

Running with the --noIndex flag seems to fix the problem, not sure if that should be default in lsp-mode, or if the server should be able to run without it?