aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/pyls_ms.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2020-12-28 17:32:20 -0800
committerMichael Lingelbach <m.j.lbach@gmail.com>2021-01-03 06:53:43 -0800
commit93c34311581ed9db125b1c41c87b8d3af7dc4c41 (patch)
tree21f20f2afc1b197b725ec1c5bab4eea9799e4cc6 /lua/lspconfig/pyls_ms.lua
parent[docgen] Update README.md (diff)
downloadnvim-lspconfig-93c34311581ed9db125b1c41c87b8d3af7dc4c41.tar
nvim-lspconfig-93c34311581ed9db125b1c41c87b8d3af7dc4c41.tar.gz
nvim-lspconfig-93c34311581ed9db125b1c41c87b8d3af7dc4c41.tar.bz2
nvim-lspconfig-93c34311581ed9db125b1c41c87b8d3af7dc4c41.tar.lz
nvim-lspconfig-93c34311581ed9db125b1c41c87b8d3af7dc4c41.tar.xz
nvim-lspconfig-93c34311581ed9db125b1c41c87b8d3af7dc4c41.tar.zst
nvim-lspconfig-93c34311581ed9db125b1c41c87b8d3af7dc4c41.zip
Remove all installers and install logic
Diffstat (limited to 'lua/lspconfig/pyls_ms.lua')
-rw-r--r--lua/lspconfig/pyls_ms.lua90
1 files changed, 2 insertions, 88 deletions
diff --git a/lua/lspconfig/pyls_ms.lua b/lua/lspconfig/pyls_ms.lua
index 517aede1..e30fc681 100644
--- a/lua/lspconfig/pyls_ms.lua
+++ b/lua/lspconfig/pyls_ms.lua
@@ -3,87 +3,6 @@ local util = require 'lspconfig/util'
local name = "pyls_ms"
-local function get_latest_pyls()
- local f = io.popen("curl -k --silent 'https://pvsc.blob.core.windows.net/python-language-server-stable?restype=container&comp=list&prefix=Python-Language-Server-osx-x64'")
- local l = f:read("*a")
- f:close()
- local version
- for w in string.gmatch (l, "x64%.(.-).nupkg") do
- version = w
- end
- return version
-end
-
-local function make_installer()
- local P = util.path.join
- local install_dir = P{util.base_install_dir, name}
-
- local bin = P{install_dir, "Microsoft.Python.LanguageServer.dll"}
- local cmd = {"dotnet", "exec", bin}
-
- local X = {}
- function X.install()
- local install_info = X.info()
- if install_info.is_installed then
- print(name, "is already installed")
- return
- end
- if not (util.has_bins("curl")) then
- error('Need "curl" to install this.')
- return
- end
- if not (util.has_bins("dotnet")) then
- error('Need ".NET Core" to install this.')
- return
- end
- if not (util.has_bins("unzip")) and (vim.fn.has('mac') == 1 or vim.fn.has('unix') == 1) then
- error('Need "unzip" to install this.')
- return
- end
-
- local system
- if vim.fn.has('mac') == 1 then
- system = 'osx'
- elseif vim.fn.has('unix') == 1 then
- system = 'linux'
- elseif vim.fn.has('win32') == 1 then
- system = 'win'
- else
- error('Unable to identify host operating system')
- end
-
- local version = get_latest_pyls()
- local url = string.format("https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-%s-x64.%s.nupkg", string.lower(system), version)
- local download_cmd = string.format('curl -fLo %s --create-dirs %s', install_info.install_dir .. "/pyls.nupkg", url)
- local install_cmd = ''
-
- if vim.fn.has('mac') == 1 or vim.fn.has('unix') == 1 then
- install_cmd = "unzip " .. install_info.install_dir .. "/pyls.nupkg -d " .. install_info.install_dir
- elseif vim.fn.has('win32') == 1 then
- install_cmd = "Expand-Archive -Force " .. install_info.install_dir .. "/pyls.nupkg -d " .. install_info.install_dir
- end
-
- vim.fn.system(download_cmd)
- vim.fn.system(install_cmd)
- end
- function X.info()
- return {
- is_installed = util.path.exists(bin);
- install_dir = install_dir;
- cmd = cmd;
- }
- end
- function X.configure(config)
- local install_info = X.info()
- if install_info.is_installed then
- config.cmd = cmd
- end
- end
- return X
-end
-
-local installer = make_installer()
-
configs[name] = {
default_config = {
@@ -100,9 +19,6 @@ configs[name] = {
};
};
};
- on_new_config = function(config)
- installer.configure(config)
- end;
init_options = {
interpreter = {
properties =
@@ -128,9 +44,9 @@ Requires [.NET Core](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-i
curl -L https://dot.net/v1/dotnet-install.sh | sh
```
-`python-language-server` can be installed via `:LspInstall pyls_ms` or you can [build](https://github.com/microsoft/python-language-server/blob/master/CONTRIBUTING.md#setup) your own.
+`python-language-server` can be installed via [build](https://github.com/microsoft/python-language-server/blob/master/CONTRIBUTING.md#setup).
-If you want to use your own build, set cmd to point to `Microsoft.Python.languageServer.dll`.
+Set cmd to point to `Microsoft.Python.languageServer.dll`.
```lua
cmd = { "dotnet", "exec", "path/to/Microsoft.Python.languageServer.dll" };
@@ -152,6 +68,4 @@ This server accepts configuration via the `settings` key.
};
};
-configs[name].install = installer.install
-configs[name].install_info = installer.info
-- vim:et ts=2 sw=2