Closed benfrain closed 11 months ago
Realise this will be better dealt with in Discord
What you mean with in Discord ?
did you find solution
Here is the Sublime Text Discord channel: https://discord.gg/D43Pecu
no, unfortunately, despite a lot of effort I haven’t found a way to use locally installed LSPs
While I would suggest just overriding the start command in LSP-typescript.sublime-settings:
{
"command": [
"${node_bin}",
"path/to/node_modules/typescript-language-server/lib/cli.mjs",
"--stdio"
],
}
I guess that will not work, because LSP-typescript will try to run npm install at some point during the setup of the package, and it will fail if you don't have access to npm.
This option will work for people who have access to npm.
Second option is to configure a Client Configuration manually and not use LSP-typescript https://lsp.sublimetext.io/client_configuration/ In LSP.sublime-settings, you can set:
{
"clients": {
"typescript-language-server": {
"enabled": true,
"command": [
"${node_bin}",
"path/to/node_modules/typescript-language-server/lib/cli.mjs",
"--stdio"
],
"selector": "source.js, source.jsx, source.ts, source.tsx",
}
},
}
That should work. The bad side is that you will lose some features that LSP-typescript provides.
@predragnikolic path/to/node_modules/
is related to which folder i'm working on. I'm working on monorepo so server path will change as i started working on some other sub package (folder)
Tangentially related; some LSPs I think make use of Python dependencies so if your environment also has packagecontrol blocked, you might also struggle because of that.
On my work machines we are unable to access npm.
Therefore, my local versions of my LSPs are installed here:
$HOME/.local/share/nvim/spec/node_modules/.bin:$PATH
Is there a way to configure LSP-typescript (or even the LSP package in general) to look here for the language servers?
I have already updated my .zshrc with this and the LSPs work fine in Neovim.
Here is the output from the ST console: