HallerPatrick / HallerPatrick/py_lsp.nvim

update for lspconfig migration in nvim>0.11

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
109
Forks
14
PR merge metrics
No merged PRs in 30d

Description

cat fix_lspconfig_migration.patch

```diff
--- init.lua 2025-10-23 21:54:37.745422242 -0700
+++ init.lua.new 2025-10-23 21:54:31.608520866 -0700
@@ -109,7 +116,11 @@
local server_opts = M.server_opts

-- Get call command of lang server
- local cmd = require("lspconfig")[option.get().language_server]["document_config"]["default_config"]["cmd"]
+ -- local cmd = require("lspconfig")[option.get().language_server]["document_config"]["default_config"]["cmd"]
+ local server_name = option.get().language_server
+ local cfg = vim.lsp.config[server_name]
+ local cmd = cfg and cfg.cmd or nil
+
-- Check weather the lsp server is installed with `nvim-lsp-installer`
if
utils.has_lsp_installed_server(option.get().language_server)
@@ -150,10 +161,12 @@
end

-- Start LSP
- nvim_lsp[option.get().language_server].setup(server_opts)
+ -- nvim_lsp[option.get().language_server].setup(server_opts)
+ local server_name = option.get().language_server
+ vim.lsp.config(server_name, server_opts)
+ vim.lsp.enable(server_name)
end

-
M.print_venv = function()
local client = lsp.get_client()
if client == nil or client.config.settings.python == nil or client.config.settings.python.pythonPath == nil then
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.