I’m writing an LSP extension, and I want to bundle the language server and everything it needs so that the user doesn’t have to manually install anything extra. I took inspiration from nova-rust which uses a shell script inside a Process to download and update its bundled language server when needed. I created this function to update the server and start it when it finishes:
function updateBundles(server) {
serverPath = nova.config.get("com.johnlindop.nova-typescript.language-server-path")
arguments = []
if (nova.inDevMode) {
arguments.push("-d")
}
if (!nova.config.get("com.johnlindop.nova-typescript.language-server-path")) {
arguments.push("-s")
}
if (nova.config.get("com.johnlindop.nova-typescript.install-fallback-typescript")) {
arguments.push("-t")
}
let updater = new Process(`${binPath}/update_language_server.sh`,
{
cwd: `${nova.extension.path}/bin`,
shell: '/usr/bin/env zsh',
args: arguments
})
updater.onDidExit(function(exitCode) {
console.log("Starting language server")
server.start(serverPath)
})
updater.start()
}
However, when I run the function, it fails with the following error:
Error: Could not find an executable for process: /Users/john/git/Nova Typescript.novaextension/bin/update_language_server.sh
@[native code]
updateBundles@file:///Users/john/git/Nova%20Typescript.novaextension/Scripts/main.js:107:15
@file:///Users/john/git/Nova%20Typescript.novaextension/Scripts/main.js:8:15
If I run the script from my terminal using that exact path, it works perfectly. I’ve declared the process
, requests
and `filesystem: readwrite" entitlements, so the extension should be able to download what it needs?