From 9b3053fd4d89a480617ee5803acbf52a2128cf6f Mon Sep 17 00:00:00 2001 From: Joshua Cold Date: Wed, 24 Dec 2025 11:55:57 -0700 Subject: [PATCH 1/3] fix(config): invalid key checking in config handles lists and doesn't throw errors instead of crashing python.nvim, show a notification as a warning. Be able to handle list-type tables by not having it be an error if the key is a number (indicating its a list) --- lua/python/config.lua | 11 ++++++++++- tests/test_config.lua | 8 +++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lua/python/config.lua b/lua/python/config.lua index a0353a8..dde0556 100644 --- a/lua/python/config.lua +++ b/lua/python/config.lua @@ -184,9 +184,18 @@ local function tbl_deep_extend_existing(target, source, prev_key) -- Overwrite existing key target[key] = value end + elseif type(key) == "number" then + -- If the key is a number then we can assume + -- that this is a table that is supposed to be a list + goto continue else - error(("python.nvim: user inputted config key: %s is not found in config table: %s"):format(key, prev_key)) + vim.notify( + ("python.nvim: user inputted config key: %s is not found in config table: %s"):format(key, prev_key), + vim.log.levels.WARN + ) + goto continue end + ::continue:: end return target end diff --git a/tests/test_config.lua b/tests/test_config.lua index 1503781..2269dcd 100644 --- a/tests/test_config.lua +++ b/tests/test_config.lua @@ -34,9 +34,11 @@ T["setup"]["override"] = function() end T["setup"]["not_found"] = function() - expect.error(function() - child.lua("config.setup({ ui = { popup = {foobar = true}} })") - end, ".*user inputted config key: foobar is not found.*") + child.lua("config.setup({ ui = { popup = {foobar = true}} })") + eq( + child.lua([[return vim.split(vim.fn.execute("messages", "silent"), "\n")]]), + { "", "python.nvim: user inputted config key: foobar is not found in config table: config.ui.popup" } + ) end -- Return test set which will be collected and execute inside `MiniTest.run()` From 5ba6bc92647c176a64dfa36de85509d1fcd96159 Mon Sep 17 00:00:00 2001 From: Joshua Cold Date: Wed, 24 Dec 2025 12:17:15 -0700 Subject: [PATCH 2/3] chore: lint on config --- lua/python/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/python/config.lua b/lua/python/config.lua index dde0556..fbe983c 100644 --- a/lua/python/config.lua +++ b/lua/python/config.lua @@ -185,7 +185,7 @@ local function tbl_deep_extend_existing(target, source, prev_key) target[key] = value end elseif type(key) == "number" then - -- If the key is a number then we can assume + -- If the key is a number then we can assume -- that this is a table that is supposed to be a list goto continue else From 1a4d1dd1d6965b669d4ffa412922ad6facc42a33 Mon Sep 17 00:00:00 2001 From: Joshua Cold Date: Wed, 24 Dec 2025 12:19:45 -0700 Subject: [PATCH 3/3] ci(nvim): remove testing for neovim 10, 11 is only supported for lspconfig --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9ee9faa..8a9e4a6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -29,7 +29,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - neovim_version: ["v0.10.4", "v0.11.3", "nightly"] + neovim_version: ["v0.11.3", "nightly"] include: - os: macos-latest neovim_version: v0.11.3