Skip to content

LSP - RestartServers when the PythonPath is changed (global or project)#1504

Open
idanmiara wants to merge 1 commit intolmbelo:masterfrom
talos-gis:feat/lsp_auto_restart
Open

LSP - RestartServers when the PythonPath is changed (global or project)#1504
idanmiara wants to merge 1 commit intolmbelo:masterfrom
talos-gis:feat/lsp_auto_restart

Conversation

@idanmiara
Copy link
Contributor

@idanmiara idanmiara commented Dec 30, 2025

related to #1404
When the Extra Python Path is changed restart the LSP server - so the LSP will register the new paths.

in #1404 (comment)
You wrote - "If you alter the python path via environment variables or registry editing, these changes will be reflected in the python path that the jedi lsp sees." -
But in my tests (latest 5.3.1) - Extra Global paths are not recognized by the LSP (even if the LSP Server is restarted),
I tried both adding the path using the GUI, and also adding to python_int.py i.e. sys.path.append(r'c:\temp\python') - neither work for the LSP (they do get recognized by the interpreter).

I added in this PR a restart also when the Global Path is changed, but this change is not helpful if the Global Path is not recognized by the LSP.

As a working workaround, you can take a look at the following approach, which does work (see latest commits to these branches):
https://github.com/talos-gis/pyscripter/tree/feat/lsp_global_path
https://github.com/talos-gis/python4delphi/tree/feat/lsp_global_path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant