aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim_lsp/pyls_ms.lua
diff options
context:
space:
mode:
authorkosayoda <kieransiek@protonmail.com>2020-07-01 10:26:08 +0800
committerkosayoda <kieransiek@protonmail.com>2020-07-01 10:31:56 +0800
commitd95644c0f6684fc4e57462bbbc790973a8367af4 (patch)
treec4e910a1c8ba4638b27a212d005b586e3665a988 /lua/nvim_lsp/pyls_ms.lua
parentMerge pull request #282 from jerrywang1981/master (diff)
downloadnvim-lspconfig-d95644c0f6684fc4e57462bbbc790973a8367af4.tar
nvim-lspconfig-d95644c0f6684fc4e57462bbbc790973a8367af4.tar.gz
nvim-lspconfig-d95644c0f6684fc4e57462bbbc790973a8367af4.tar.bz2
nvim-lspconfig-d95644c0f6684fc4e57462bbbc790973a8367af4.tar.lz
nvim-lspconfig-d95644c0f6684fc4e57462bbbc790973a8367af4.tar.xz
nvim-lspconfig-d95644c0f6684fc4e57462bbbc790973a8367af4.tar.zst
nvim-lspconfig-d95644c0f6684fc4e57462bbbc790973a8367af4.zip
Remove call to get Python interpreter and version.
By default, the Microsoft Python Language Server already gets an existing Python interpreter and version from $PATH if the setting is an empty string or null. https://github.com/microsoft/python-language-server/blob/838ba78e00173d639bd90f54d8610ec16b4ba3a2/src/LanguageServer/Impl/Implementation/Server.cs#L143 Looking for `python` and launching the interpreter to get the version on our end is redundant and time-consuming.
Diffstat (limited to 'lua/nvim_lsp/pyls_ms.lua')
-rw-r--r--lua/nvim_lsp/pyls_ms.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/lua/nvim_lsp/pyls_ms.lua b/lua/nvim_lsp/pyls_ms.lua
index fa8241b4..6b66a600 100644
--- a/lua/nvim_lsp/pyls_ms.lua
+++ b/lua/nvim_lsp/pyls_ms.lua
@@ -3,13 +3,6 @@ local util = require 'nvim_lsp/util'
local name = "pyls_ms"
-local function get_python_version()
- local f = io.popen("python --version 2>&1") -- runs command
- local l = f:read("*a") -- read output of command
- f:close()
- return l:match("^Python%s*(...).*%s*$")
-end
-
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")
@@ -110,8 +103,8 @@ configs[name] = {
interpreter = {
properties =
{
- InterpreterPath = vim.fn.exepath("python");
- Version = get_python_version();
+ InterpreterPath = "";
+ Version = "";
};
};
displayOptions = {};
@@ -139,6 +132,13 @@ If you want to use your own build, set cmd to point to `Microsoft.Python.languag
cmd = { "dotnet", "exec", "path/to/Microsoft.Python.languageServer.dll" };
```
+If the `python` interpreter is not in your PATH environment variable, set the `InterpreterPath` and `Version` properties accordingly.
+
+```lua
+InterpreterPath = "path/to/python",
+Version = "3.8"
+```
+
This server accepts configuration via the `settings` key.
]];