MaskRay / vscode-ccls

ccls plugin for Visual Studio Code
123 stars 37 forks source link

Feature Request: Support "cwd" option for launching #114

Closed LazyRen closed 3 years ago

LazyRen commented 3 years ago

Observed behavior

Currently, vscode-ccls only supports launch command & args. Most of the time it is sufficient, but if launch command is heavily dependent on the "cwd", extension cannot launch 'ccls' properly.

In my case, I need to run ccls via company-specific profram which requires specific folder inplaced from 'cwd'.

luckily nodejs supports 'cwd', so if it is possible I hope to see extension support it through settings.json.

Expected behavior

Support 'cwd' option through settings.json

Simply modifying const child = cp.spawn(this.cliConfig.launchCommand, args); to const child = cp.spawn(this.cliConfig.launchCommand, args, {cwd: this.cwd});

worked for me.