aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/pyls_ms.lua
blob: 88e48666a2a151c83b6bc3ae06532341af7674af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local name = 'pyls_ms'

configs[name] = {

  default_config = {
    filetypes = { 'python' },
    root_dir = function(fname)
      return util.find_git_ancestor(fname) or vim.loop.os_homedir()
    end,
    settings = {
      python = {
        analysis = {
          errors = {},
          info = {},
          disabled = {},
        },
      },
    },
    init_options = {
      interpreter = {
        properties = {
          InterpreterPath = '',
          Version = '',
        },
      },
      displayOptions = {},
      analysisUpdates = true,
      asyncStartup = true,
    },
  },
  docs = {
    description = [[
https://github.com/Microsoft/python-language-server

`python-language-server`, a language server for Python.

Requires [.NET Core](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script) to run. On Linux or macOS:

```bash
curl -L https://dot.net/v1/dotnet-install.sh | sh
```

`python-language-server` can be installed via [build](https://github.com/microsoft/python-language-server/blob/master/CONTRIBUTING.md#setup).

Set cmd to point to `Microsoft.Python.languageServer.dll`.

```lua
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.

    ]],
    default_config = {
      root_dir = "vim's starting directory",
    },
  },
}

-- vim:et ts=2 sw=2