aboutsummaryrefslogtreecommitdiffstats
path: root/CUSTOM_SERVERS.md
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-10 13:38:39 +0200
committerGitHub <noreply@github.com>2021-09-10 13:38:39 +0200
commitd2ec0c0070c01ba0e3e8926031cfe848a016df44 (patch)
treebf57f20725e11125ed51caac547c483d4e642831 /CUSTOM_SERVERS.md
parentCUSTOM_SERVERS.md: update docs (diff)
downloadmason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar
mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.gz
mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.bz2
mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.lz
mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.xz
mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.zst
mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.zip
rewrite some installers for broader cross-platform support (#85)
- Remove all usage of zx in favour of native Lua (via libuv) - Introduce new set of `std` installers The following servers will have to be reinstalled due to this change: 1. clangd 2. solargraph 3. sumneko_lua 4. tailwindcss
Diffstat (limited to 'CUSTOM_SERVERS.md')
-rw-r--r--CUSTOM_SERVERS.md32
1 files changed, 12 insertions, 20 deletions
diff --git a/CUSTOM_SERVERS.md b/CUSTOM_SERVERS.md
index cffad236..40b03cbf 100644
--- a/CUSTOM_SERVERS.md
+++ b/CUSTOM_SERVERS.md
@@ -154,23 +154,10 @@ available installers that are available out of the box.
shell.polyshell("git clone --depth 1 https://github.com/microsoft/vscode-eslint . && npm install && npm run compile:server")
```
-- ### zx
+- ### std
- [zx](https://github.com/google/zx) is a tool for writing better scripts. It's a suitable install method for servers
- that for example have many different steps or branches into different steps depending on some logic.
-
- #### `zx.file(relpath: string)`
-
- Returns an installer that executes the provided file as a `zx` script. `relpath` is the relative path (of the current
- Lua file) to the script file.
-
- Example:
-
- ```lua
- local zx = require "nvim-lsp-installer.installers.zx"
-
- local installer = zx.file("./install.mjs")
- ```
+ `std` is a collection of standard installers that provides cross-platform implementations for common tasks. Refer to
+ the source code for more information.
## Composing installers
@@ -182,12 +169,17 @@ Example:
```lua
local installers = require "nvim-lsp-installer.installers"
local shell = require "nvim-lsp-installer.installers.shell"
+local std = require "nvim-lsp-installer.installers.std"
-installers.join {
+installers.pipe {
+ std.download_file("Https://my.file/stuff.zip", "out.zip"),
+ std.unzip("out.zip"),
+ std.delete_file("out.zip"),
npm.packages { "some-package" },
pip3.packages { "another-package" },
- shell.raw [[ exit 1 ]],
- shell.raw [[ echo "I won't run at all because the previous installer failed." ]],
+ installers.on {
+ unix = shell.bash [[ chmod +x something ]],
+ },
}
```
@@ -215,7 +207,7 @@ configs[server_name] = {
local root_dir = server.get_server_root_path(server_name)
--- You may also use one of the prebuilt installers (e.g., npm, pip3, go, shell, zx).
+-- You may also use one of the prebuilt installers (e.g., std, npm, pip3, go, gem, shell).
local my_installer = function(server, callback, context)
local is_success = code_that_installs_given_server(server)
if is_success then