Skip to content

Use the correct type name for generic and nested types - #63

Merged
carlossanlop merged 5 commits into
dotnet:mainfrom
jeffhandley:jeffhandley/generic-nested-types
Apr 1, 2021
Merged

carlossanlop merged 5 commits into
dotnet:mainfrom
jeffhandley:jeffhandley/generic-nested-types

Conversation

@jeffhandley

Copy link
Copy Markdown
Member

Generic and nested type names were not getting formatted correctly. This was preventing docs for those types from getting ported into triple slash comments.

This was discovered while attempting to port System.Buffers and System.Memory for dotnet/runtime#48967 and dotnet/runtime#48964. The first symptom was that ArrayPool<T> docs were not getting ported. The second symptom was that ReadOnlySequence<T>.Enumerator docs were not getting ported.

Based on this discovery, I suspect any libraries already ported that contain public generic or nested types would need to have the tool rerun.

@jeffhandley
jeffhandley force-pushed the jeffhandley/generic-nested-types branch from 7d1d303 to 96df9b7 Compare March 31, 2021 02:22

@carlossanlop carlossanlop left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this change.
I left one suggested change: change internal to public or protected. I'm going to investigate why the tests passed.
Let's wait for @safern 's help with the error we both saw when we were using net6.0 in our csproj files:

"    Failure - Msbuild failed when processing the file 'C:\\Users\\jeffhand\\AppData\\Local\\Temp\\j30a5b3g.krp\\Project\\MyAssembly.csproj' with message: The expression \"[MSBuild]::GetTargetFrameworkIdentifier(net5.0)\" cannot be evaluated. MSB0001: Internal MSBuild Error: A required NuGet assembly was not found. Expected Path: C:\\Program Files\\dotnet\\sdk\\6.0.100-preview.2.21158.2  C:\\Program Files\\dotnet\\sdk\\6.0.100-preview.2.21158.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.TargetFrameworkInference.targets"

Our workaround to be able to run the unit tests was to temporarily switch back to net5.0, but we should not merge that.

@jeffhandley
jeffhandley force-pushed the jeffhandley/generic-nested-types branch from 96df9b7 to 11a8df5 Compare April 1, 2021 01:15
@jeffhandley
jeffhandley marked this pull request as ready for review April 1, 2021 01:17
@jeffhandley

Copy link
Copy Markdown
Member Author

I've pushed a new set of commits to this.

  • This is now stacked on top of Work around the SDK error with 6.0.0-preview #70, which provides a workaround for running tests against net6.0 locally (when 5.0 SDK installs are also present)
  • I added tests for generics (and nested types) that failed before the fix. The key was for the generic type to be in a separate file from other types that were discovered.
  • I created the generics+nested type tests in a completely new test to ensure no side effects of the other test were in play.

@safern

safern commented Apr 1, 2021

Copy link
Copy Markdown
Member

Based on this discovery, I suspect any libraries already ported that contain public generic or nested types would need to have the tool rerun.

I think it's time to enable the Roslyn warning to catch missing comments on public APIs for the projects that are already ported or being ported? Maybe we can do this by some property we require on the project to be set or by a way to identify that project has been ported.

Comment thread Libraries/ToTripleSlashPorter.cs Resolved

@carlossanlop carlossanlop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a new set of commits to this.

  • This is now stacked on top of #70, which provides a workaround for running tests against net6.0 locally (when 5.0 SDK installs are also present)
  • I added tests for generics (and nested types) that failed before the fix. The key was for the generic type to be in a separate file from other types that were discovered.
  • I created the generics+nested type tests in a completely new test to ensure no side effects of the other test were in play.

@jeffhandley Thank you for the changes! LGTM as it is. I can merge it unless you tell me otherwise.

I think it's time to enable the Roslyn warning to catch missing comments on public APIs for the projects that are already ported or being ported? Maybe we can do this by some property we require on the project to be set or by a way to identify that project has been ported.

@safern We can discuss that separately. If we need to add some functionality to the tool to address this, we can do it in a separate PR.

@safern

safern commented Apr 1, 2021

Copy link
Copy Markdown
Member

@safern We can discuss that separately. If we need to add some functionality to the tool to address this, we can do it in a separate PR.

I don't think we need to do it as part of the tool, but I mean we should take action in dotnet/runtime and fix that because that would help catch issues like this if any when porting docs, rather than catching later on and having to re-port docs to assemblies that were supposedly already ported.

@jeffhandley

Copy link
Copy Markdown
Member Author

Cool; thanks! Merge away, @carlossanlop.

@carlossanlop
carlossanlop merged commit 1d55f6e into dotnet:main Apr 1, 2021
@jeffhandley
jeffhandley deleted the jeffhandley/generic-nested-types branch April 1, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants