Skip to content

Commit

Permalink
Revert "Python Projects losing Search Paths on reload fix microsoft#5768
Browse files Browse the repository at this point in the history
 (microsoft#5781)" (microsoft#5786)

This reverts commit f4243e0.
  • Loading branch information
bschnurr authored Oct 2, 2019
1 parent f4243e0 commit d44da0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -961,11 +961,11 @@ public IList<string> GetSearchPaths(bool withImplied = true) {
_searchPaths.GetAbsolutePersistedSearchPaths();
}

internal void OnUpdateSearchPath(string absolutePath, object moniker) {
internal void OnInvalidateSearchPath(string absolutePath, object moniker) {
if (string.IsNullOrEmpty(absolutePath)) {
// Clear all paths associated with this moniker
_searchPaths.RemoveByMoniker(moniker);
} else if (!_searchPaths.AddOrReplace(moniker, absolutePath, true)) {
} else if (!_searchPaths.AddOrReplace(moniker, absolutePath, false)) {
// Didn't change a search path, so we need to trigger reanalysis
// manually.
UpdateAnalyzerSearchPaths();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private async Task UpdateSearchPathAsync() {
searchPath = await GetOutputPathAsync();
}

(ProjectMgr as PythonProjectNode)?.OnUpdateSearchPath(searchPath, this);
(ProjectMgr as PythonProjectNode)?.OnInvalidateSearchPath(searchPath, this);
}

private async Task<string> GetOutputPathAsync(int retries = 10) {
Expand Down Expand Up @@ -120,7 +120,7 @@ private void EventListener_AfterActiveSolutionConfigurationChange(object sender,

public override bool Remove(bool removeFromStorage) {
if (base.Remove(removeFromStorage)) {
(ProjectMgr as PythonProjectNode)?.OnUpdateSearchPath(null, this);
(ProjectMgr as PythonProjectNode)?.OnInvalidateSearchPath(null, this);
return true;
}
return false;
Expand Down

0 comments on commit d44da0d

Please sign in to comment.