File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,9 +60,29 @@ PythonLSP.python_lsp_servers = {
6060 end ,
6161 },
6262 ty = {
63- callback = function (_ , client )
64- vim .notify_once (string.format (" python.nvim: restart lsp client: '%s'" , client .name ), vim .log .levels .INFO )
65- vim .cmd (" :LspRestart ty" )
63+ callback = function (venv_path , client )
64+ local new_settings = vim .tbl_deep_extend (" force" , client .settings , {
65+ pythonExtension = {
66+ activeEnvironment = {
67+ version = {
68+ major = 3 ,
69+ minor = 12 ,
70+ patch = 0 ,
71+ sysVersion = " 3.12" ,
72+ },
73+ environment = {
74+ folderUri = " file://" .. vim .fs .joinpath (venv_path , " /bin/python" ),
75+ uri = vim .fs .basename (venv_path ),
76+ type = " VirtualEnvironment" ,
77+ },
78+ executable = {
79+ uri = " file://" .. vim .fs .joinpath (venv_path , " /bin/python" ),
80+ sysPrefix = venv_path ,
81+ },
82+ },
83+ },
84+ })
85+ call_did_change_configuration (client , new_settings )
6686 end ,
6787 },
6888 -- For my homies in devops
You can’t perform that action at this time.
0 commit comments