Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit 484443d

Browse files
committed
Merge remote-tracking branch 'Microsoft/master'
2 parents bde584f + ab73385 commit 484443d

4 files changed

Lines changed: 5 additions & 21 deletions

File tree

src/Analysis/Engine/Impl/Interpreter/Ast/AstAnalysisFunctionWalker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void Walk() {
6565
var self = GetSelf();
6666
_selfType = (self as AstPythonConstant)?.Type as AstPythonType;
6767

68-
_overload.ReturnTypes.AddRange(_scope.GetTypesFromAnnotation(_target.ReturnAnnotation));
68+
_overload.ReturnTypes.AddRange(_scope.GetTypesFromAnnotation(_target.ReturnAnnotation).ExcludeDefault());
6969

7070
_scope.PushScope();
7171
if (self != null) {
@@ -163,7 +163,7 @@ public override bool Walk(IfStatement node) {
163163
}
164164

165165
public override bool Walk(ReturnStatement node) {
166-
foreach (var type in _scope.GetTypesFromValue(_scope.GetValueFromExpression(node.Expression))) {
166+
foreach (var type in _scope.GetTypesFromValue(_scope.GetValueFromExpression(node.Expression)).ExcludeDefault()) {
167167
_overload.ReturnTypes.Add(type);
168168
}
169169
return true; // We want to evaluate all code so all private variables in __new__ get defined

src/LanguageServer/Impl/Implementation/Server.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,6 @@ private async Task OnDocumentChangeProcessingCompleteAsync(IDocument doc, Versio
654654
if (vc != null) {
655655
_editorFiles.GetDocument(doc.DocumentUri).UpdateParseDiagnostics(vc, doc.DocumentUri);
656656
}
657-
658-
if (doc is ProjectEntry entry) {
659-
var reanalyzeEntries = Analyzer.GetEntriesThatImportModule(entry.ModuleName, false);
660-
foreach (var d in reanalyzeEntries.OfType<IDocument>()) {
661-
await EnqueueItemAsync(d, parse: false);
662-
}
663-
}
664657
} catch (BadSourceException) {
665658
} catch (ObjectDisposedException) when (_disposableBag.IsDisposed) {
666659
} catch (OperationCanceledException ex) {

src/LanguageServer/Impl/LanguageServer.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,7 @@ public async Task DidChangeConfiguration(JToken token, CancellationToken cancell
152152
_idleTimeTracker?.Dispose();
153153
_idleTimeTracker = new IdleTimeTracker(settings.diagnosticPublishDelay, PublishPendingDiagnostics);
154154

155-
_pathsWatcher?.Dispose();
156-
var watchSearchPaths = GetSetting(analysis, "watchSearchPaths", true);
157-
if (watchSearchPaths) {
158-
if (!_searchPaths.SetEquals(_initParams.initializationOptions.searchPaths)) {
159-
_pathsWatcher = new PathsWatcher(
160-
_initParams.initializationOptions.searchPaths,
161-
() => _server.ReloadModulesAsync(CancellationToken.None).DoNotWait(),
162-
_server
163-
);
164-
}
165-
}
155+
HandlePathWatchChange(token);
166156

167157
var errors = GetSetting(analysis, "errors", Array.Empty<string>());
168158
var warnings = GetSetting(analysis, "warnings", Array.Empty<string>());

src/LanguageServer/Impl/PathsWatcher.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public PathsWatcher(string[] paths, Action onChanged, ILogger log) {
6262
fsw.Deleted += OnChanged;
6363

6464
_disposableBag
65+
.Add(() => _throttleTimer?.Dispose())
6566
.Add(() => fsw.Created -= OnChanged)
6667
.Add(() => fsw.Deleted -= OnChanged)
6768
.Add(() => fsw.EnableRaisingEvents = false)
@@ -83,7 +84,7 @@ private void OnChanged(object sender, FileSystemEventArgs e) {
8384

8485
private void TimerProc(object o) {
8586
lock (_lock) {
86-
if (_changedSinceLastTick) {
87+
if (!_changedSinceLastTick) {
8788
ThreadPool.QueueUserWorkItem(_ => _onChanged());
8889
_throttleTimer?.Dispose();
8990
_throttleTimer = null;

0 commit comments

Comments
 (0)