-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add ability to find symbol in mono corelib and in other platform locations #26
Conversation
Libraries/ToTripleSlashPorter.cs
Outdated
ProjectInformation? pd = null; | ||
INamedTypeSymbol? symbol = null; | ||
|
||
if (TryFindSymbolInReferencedProject(projectPath, docsType.FullName, isMono: false, out pd, out symbol) || |
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 not exactly what I meant.
What I meant is if the symbol location is under src/libraries/
tree. Even when the compilation doesn't set RuntimeFlavor=mono
, it could resolve symbols where it's location is: src/coreclr/System.Private.CoreLib/*
, and that is when the symbol would appear in the mono and coreclr System.Private.CoreLib.
Basically the way that you have it, this first call to TryFindSymbolInReferenceProject
will always return true for projectFileName == 'System.Private.CoreLIb
. The reason for that is because both System.Private.CoreLib need to have the same public apis defined.
So basically what you have to do is.
call TryFindSymbolInReferencedProject(....)
, then if that is successful, then check symbol.location
file path and if the file path lives under src/coreclr/*
then that is when you need to call in TryFindSymbolInReferencedPRoject(..., isMono: true, ...)
.
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.
Ok thanks.
I need an example of this though. I can use an API from System.IO.FileSystem, like FileStream, to try to find a mono implementation. I think that type is one of those cases.
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.
@safern I think I am doing the right thing now. PTAL when you get a chance.
Only look inside referenced projects that are explicitly included and not explicitly excluded (by namespace).
… or protected modifier. Add unit test.
If a symbol is not found in the main project, we look for it in the referenced projects. If one of the projects happens to be System.Private.CoreLib, and we don't find the symbol in the Libraries version, then we have to try to find it in the Mono version.
If a symbol has multiple implementations for different platforms, ensure to port comments to those files too.
cc @safern