Skip to content

Commit

Permalink
fix(pyright): fix PyrightSetPythonPath command
Browse files Browse the repository at this point in the history
  • Loading branch information
neolooong committed Feb 26, 2024
1 parent ec7d51a commit 965592a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/lspconfig/server_configurations/pyright.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ local function set_python_path(path)
name = 'pyright',
}
for _, client in ipairs(clients) do
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
if client.settings then
client.settings.python = vim.tbl_deep_extend('force', client.settings.python, { pythonPath = path })
else
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
end
client.notify('workspace/didChangeConfiguration', { settings = nil })
end
end
Expand Down

0 comments on commit 965592a

Please sign in to comment.