onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.35k stars 299 forks source link

TypeScript language service does not work with path with spaces #334

Closed bryphe closed 7 years ago

bryphe commented 7 years ago

Additional issue following from #329.

Repro: 1) Clone Oni into a folder path with spaces 2) Build & Run Oni 3) Open debugger

Turns out the typescript language service will also not start if the root path for Oni has spaces in it:

Error from tss: module.js:472
    throw err;
    ^

Error: Cannot find module 'C:\test'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3

(anonymous) @ C:\test folder with spaces\oni\vim\core\oni-plugin-typescript\lib\TypeScriptServerHost.js:53
C:\test folder with spaces\oni\vim\core\oni-plugin-typescript\lib\TypeScriptServerHost.js:43 Error: Command failed: node C:\test folder with spaces\oni\node_modules\typescript\lib\tsserver.js
module.js:472
    throw err;
    ^

Error: Cannot find module 'C:\test'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3

    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3

    at ChildProcess.exithandler (child_process.js:223:12)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:885:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

This means that none of the JavaScript / TypeScript language service functionality work in this scenario.

bryphe commented 7 years ago

Committed a fix to add quotes around the path