-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pylance will request PTVS to listen for "**/*" under root but we dont… #8059
Pylance will request PTVS to listen for "**/*" under root but we dont… #8059
Conversation
… want to listen for file events in the interpreter folder. We already have conda and pip managers listening to them. This fixes the issue of deleting an "env" folder then having PTVS quickly switching to the default env folder and tells Pylance to update its interpreter settings but the previous env folder file evnets are still being triggered and after Pylance updates its config it will keep refreshing analysis due to previous env file events.
@@ -99,7 +99,7 @@ internal sealed class PythonLanguageClient : ILanguageClient, ILanguageClientCus | |||
private static TaskCompletionSource<int> _readyTcs = new TaskCompletionSource<int>(); | |||
private bool _loaded = false; | |||
private Timer _deferredSettingsChangedTimer; | |||
private const int _defaultSettingsDelayMS = 2000; | |||
private const int _defaultSettingsDelayMS = 5000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
increasing settings delay helps delay analysis on while installing new packages
Python/Product/PythonTools/PythonTools/LanguageServerClient/PythonLanguageClient.cs
Outdated
Show resolved
Hide resolved
…thonLanguageClient.cs
Quality Gate passedIssues Measures |
if (PathUtils.IsSubpathOf(context.RootPath, context.InterpreterConfiguration.InterpreterPath)) { | ||
var pattern = CommonUtils.GetRelativeFilePath(context.RootPath, context.InterpreterConfiguration.GetPrefixPath()) + "/**/*"; | ||
var watcher = new FileSystemWatcher() { GlobPattern = pattern }; | ||
this._fileListener.AddExclude(watcher); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the fix. just exclude files under the interpreter if the interpreter is under the root workspace
… want to listen for file events in the interpreter folder. We already have conda and pip managers listening to them.
This fixes the issue of deleting an "env" folder then having PTVS quickly switching to the default env folder and tells Pylance to update its interpreter settings but the previous env folder file events are still being triggered and after Pylance updates its config it will keep refreshing analysis due to previous env file events.
fixes #8058