python

LanguageServer

pylsp を選択した。型対応があって pyright が強そうなのだけど。

  • https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#pylsp
require'lspconfig'.pylsp.setup{}
  • python3 で動く

  • pyls は python2 仕様の print 文があって python3 では動かない

  • completion

  • formatter

DebugAdapter

$ pip install debugpy

local dap = require("dap")
dap.adapters.python = {
    type = "executable",
    command = "C:/Python38/python.exe",
    args = { "-m", "debugpy.adapter" },
}
dap.configurations.python = {
    {
        type = "python",
        request = "launch",
        name = "Launch file",
        program = "${file}",
        pythonPath = function()
            return "C:/Python38/python.exe"
        end,
    },
}