You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
PLS doesn't handle changes to python.autoComplete.extraPaths setting #507
If I define one or more entries in the python.autoComplete.extraPaths setting, the PLS correctly uses the defined path(s) as part of its import resolution. However, if I modify the setting, the PLS doesn't correctly pick up the change. Closing and opening the IDE solves the problem.
I'm not sure if this is a problem with the vscode python extension or the PLS.
LS receives extraPaths as part of PythonInitializationOptions.searchPaths when it is started. Mikhail Arkhipov (@MikhailArkhipov) , do you know if LS is restarted when this parameter is changed?
However, change of configuration does not restart the LS and current implementation is not capable of handling the search path update without the restart. Restarting IDE is not necessary, there is 'Reload Window' command in VS Code.
Is it not possible for the LS to react to changes to this setting if it was somehow propagated to LS.
Ie can LS react to changes without having to restart the LS.
With #1289 merged, this could now be possible. Paths are now resolved later at the first ReloadAsync, versus in the initialization. Since the extension has been starting the language server with PYTHONPATH set, we could stop accepting searchPaths in our initialization options, then do the combining of PYTHONPATH/extraPaths together ourselves. Doing this would allow us to redo that work when we see the config change.
But we'd need to decide whether or not python.autoComplete.extraPaths is the actual configuration name we want to give this. I expect we want settings under python.analysis instead, with some more granularity to let people pick and choose which paths go where (instead of a big list).
Activity
AlexanderSher commentedon Dec 31, 2018
LS receives
extraPathsas part ofPythonInitializationOptions.searchPathswhen it is started. Mikhail Arkhipov (@MikhailArkhipov) , do you know if LS is restarted when this parameter is changed?MikhailArkhipov commentedon Jan 2, 2019
It didn't change AFAIK.
https://github.com/Microsoft/vscode-python/blob/master/src/client/activation/languageServer/languageServer.ts#L246-253
However, change of configuration does not restart the LS and current implementation is not capable of handling the search path update without the restart. Restarting IDE is not necessary, there is 'Reload Window' command in VS Code.
DonJayamanne commentedon Jan 3, 2019
Is it not possible for the LS to react to changes to this setting if it was somehow propagated to LS.
Ie can LS react to changes without having to restart the LS.
MikhailArkhipov commentedon Jun 20, 2019
May be part of #1213
jakebailey commentedon Jul 10, 2019
With #1289 merged, this could now be possible. Paths are now resolved later at the first
ReloadAsync, versus in the initialization. Since the extension has been starting the language server with PYTHONPATH set, we could stop acceptingsearchPathsin our initialization options, then do the combining of PYTHONPATH/extraPaths together ourselves. Doing this would allow us to redo that work when we see the config change.But we'd need to decide whether or not
python.autoComplete.extraPathsis the actual configuration name we want to give this. I expect we want settings underpython.analysisinstead, with some more granularity to let people pick and choose which paths go where (instead of a big list).Jma353 commentedon Jul 12, 2019
Moving away from
searchPathsand towards config-drivenextraPathsthat reacts to changes in the config would be awesome!jakebailey commentedon Jul 25, 2019
I'm going to close this in favor of #1388. This should now be doable (as previously said). The setting name is likely to change, as it's a relic.