use the source instead of the name to find nuget packages#35397
use the source instead of the name to find nuget packages#35397jmarolf merged 1 commit intodotnet:masterfrom
Conversation
a378d22 to
0d8d2af
Compare
|
@jmarolf looks like this broke the nuget feature. can you take a look? just install latest d16.2stg and create Console app and add JObject and see whether newtonsoft package is offered for JObject. what I see is _sourceToDatabase - http://source.roslyn.io/#Microsoft.CodeAnalysis.EditorFeatures.Wpf/SymbolSearch/SymbolSearchUpdateEngine.cs,28 is initialized with package source uri but given source is package source name so, _sourceToDatabase.TryGetValue never succeed. |
| // Always pull down the nuget.org index. It contains the MS reference assembly index | ||
| // inside of it. | ||
| Task.Run(() => UpdateSourceInBackgroundAsync(SymbolSearchUpdateEngine.NugetOrgSource)); | ||
| Task.Run(() => UpdateSourceInBackgroundAsync(SymbolSearchUpdateEngine.NugetOrgSourceUri)); |
There was a problem hiding this comment.
so, this is the bug. this gives Uri which will make _sourceToDatabase to have its key with uri, but the call above _sourceToDatabase.TryGetValue gets NugetOrgSourceName. so it will never be found.
| updateCancellationToken:=cancellationTokenSource.Token) | ||
|
|
||
| Await service.UpdateContinuouslyAsync(SymbolSearchUpdateEngine.NugetOrgSource, "TestDirectory") | ||
| Await service.UpdateContinuouslyAsync(SymbolSearchUpdateEngine.NugetOrgSourceName, "TestDirectory") |
There was a problem hiding this comment.
hmm.. why real code call Update with Uri and test call Update with SourceName?
|
I think you need to change everything to use Uri rather than Name. also, _sourceToDatabase (http://source.roslyn.io/#Microsoft.CodeAnalysis.EditorFeatures.Wpf/SymbolSearch/SymbolSearchUpdateEngine.cs,28) seems to use default string comparison for key which can also be a problem. I think better way might be just using Uri type as key for the map. and give it comparer for Uri. |
|
@heejaechang thanks for the analysis, and sorry for breaking this. I'll send a PR |


fixes #27010