From a097fa4c04e6db34bb409e0dea302c20629da8ec Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Tue, 13 Jul 2021 21:13:55 -0400 Subject: LunarVim 0.4.8 (#919) --- ftplugin/python.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'ftplugin/python.lua') diff --git a/ftplugin/python.lua b/ftplugin/python.lua index 0cf7c1a7..d2ade7e2 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -1,6 +1,21 @@ +O.formatters.filetype["python"] = { + function() + return { + exe = O.lang.python.formatter.exe, + args = O.lang.python.formatter.args, + stdin = not (O.lang.python.formatter.stdin ~= nil), + } + end, +} + +require("formatter.config").set_defaults { + logging = false, + filetype = O.formatters.filetype, +} + local python_arguments = {} --- TODO replace with path argument +-- TODO: replace with path argument local flake8 = { LintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -", lintStdin = true, @@ -25,6 +40,7 @@ if not require("lv-utils").check_lsp_client_active "efm" then -- init_options = {initializationOptions}, cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, init_options = { documentFormatting = true, codeAction = false }, + root_dir = require("lspconfig").util.root_pattern(".git/", "requirements.txt"), filetypes = { "python" }, settings = { rootMarkers = { ".git/", "requirements.txt" }, @@ -63,7 +79,7 @@ if not require("lv-utils").check_lsp_client_active "pyright" then } end -if O.plugin.debug.active and O.plugin.dap_install.active then +if O.plugin.dap.active then local dap_install = require "dap-install" dap_install.config("python_dbg", {}) end -- cgit v1.2.3