KirillOsenkov / SourceBrowser

Source browser website generator that powers http://referencesource.microsoft.com and http://sourceroslyn.io
Apache License 2.0
1.08k stars 197 forks source link

Clicks on value tuple items are broken [source.dot.net] #221

Open hankovich opened 2 years ago

hankovich commented 2 years ago

This page, for example

if (_connections.TryGetValue(id, out var pair)) // _connections is ConcurrentDictionary<string, (HttpConnectionContext Connection, ValueStopwatch Timer)>
{
    connection = pair.[Connection](https://source.dot.net/System.Private.CoreLib/A.html#22818ac7b7f5b2ab);
    return true;
}

Clicking on .Connection; redirects to this page, which says Don't use this page directly, pass #symbolId to get redirected..

I've tried a couple of ValueTuples with different arity, all of them don't work.

@alexperovich

alexperovich commented 2 years ago

I'm not sure if there is any useful location this can go to. Would you want it to go to ValueTuple<T1, T2>.Item1?

hankovich commented 2 years ago

I think at least it should not point to an unexisting location. Item1 feels like a good alternative.

KirillOsenkov commented 2 years ago

Should it go to the type of Item1 instead? Would be more useful I think.

KirillOsenkov commented 2 years ago

This is roughly the place that is looking at the current identifier, sees it's a reference to a symbol, sees the symbol is a field and does the processing: https://github.com/KirillOsenkov/SourceBrowser/blob/2b57a3d551d02c05b90d006f48cfa07c0a7e5cd2/src/HtmlGenerator/Pass1-Generation/DocumentGenerator.References.cs#L335

I think roughly in this area we could add some could that would detect that we're looking at a value tuple field, get its type, and create a hyperlink to that type.