Workaround: Purescript IDE in VS.Code not working on Windows

First some background: The issue is caused by this breaking security-fix that’s quite old.

I only noticed a couple of weeks back (yeah don’t update Node that often :sweat_smile: )


Luckily VS.code gives some clear hints on where the error is thrown - it’s in the .vscode/extensions/nwolverson.ide-purescript-026.3/dist/server.js.

The file is minimized so I’d suggest auto-formatting it first (so that it’s not all in a few very long lines).

For me there where two places I needed to insert a .shell = true override:

Around line 20600 (after formatting):

function iee (e) {
  return n => t =>
    function () {
      t.shell = true
      return (0, PD.spawn)(e, n, t)
    }
}

(note that I did rewrite the lambda into a function)

and around 20620

var PD,
  aee,
  P8,
  Ei,
  D3 = b({
    'output/Node.ChildProcess/foreign.js' () {
      ;(PD = vu(require('child_process'))),
        (aee = vu(require('process'))),
        (P8 = function (n) {
          return t => r => u =>
            function () {
              // here!
              r.shell = true
              return (0, PD.execFile)(n, t, r, (i, o, a) => {
                u(i)(o)(a)()
              })
            }
        }),
        (Ei = void 0)
    }
  }),
...

so one case of spawn and one case of execFile - after the plugin works for me as expected.


I opened an issue but got no reply so far (maybe I opened it on the wrong repo though - the problem is probably in the common IDE code)

Maybe this can help someone puzzling over this.

2 Likes

I have been trying to get the language server to work for hours. This solved it. Thank you.