Allow xml docs to still be created when 'emit metadata only' is on.#57667
Merged
CyrusNajmabadi merged 17 commits intodotnet:mainfrom Jan 21, 2022
Merged
Allow xml docs to still be created when 'emit metadata only' is on.#57667CyrusNajmabadi merged 17 commits intodotnet:mainfrom
CyrusNajmabadi merged 17 commits intodotnet:mainfrom
Conversation
CyrusNajmabadi
commented
Nov 10, 2021
Contributor
Author
|
@dotnet/roslyn-compiler ptal :) |
…mabadi/roslyn into metadataOnlyEmitXmlDocs
jcouv
reviewed
Nov 15, 2021
jcouv
reviewed
Nov 15, 2021
jcouv
reviewed
Nov 15, 2021
jcouv
reviewed
Nov 15, 2021
Member
jcouv
left a comment
There was a problem hiding this comment.
Done with review pass (iteration 7)
a0c3984 to
f6b9a4a
Compare
jcouv
reviewed
Dec 6, 2021
| { | ||
| public static void SayHello() | ||
| { | ||
| ConEmitMetadataOnly_XmlDocs_NoDocMode_Successsole.WriteLine(""hello""); |
Member
jcouv
approved these changes
Dec 6, 2021
Member
jcouv
left a comment
There was a problem hiding this comment.
LGTM Thanks (iteration 10) modulo typo in test
Member
|
@dotnet/roslyn-compiler for second review. Thanks |
RikkiGibson
approved these changes
Jan 18, 2022
Member
RikkiGibson
left a comment
There was a problem hiding this comment.
LGTM except the feedback above (just have to address before merge).
| xmlDocBytes = xmlStream.ToArray(); | ||
| } | ||
|
|
||
| // This should not fail the emit (as it's a warning). |
Member
There was a problem hiding this comment.
nit: Please remove this comment here and the one below // Even though docs failed, ...
Member
|
Feel free to merge/squash once the typo and last comment are addressed/considered. Thanks |
CyrusNajmabadi
commented
Jan 20, 2022
| { | ||
| public static void SayHello() | ||
| { | ||
| ConEmitMetadataOnly_XmlDocs_NoDocMode_Successsole.WriteLine(""hello""); |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| ConEmitMetadataOnly_XmlDocs_NoDocMode_Successsole.WriteLine(""hello""); | |
| EmitMetadataOnly_XmlDocs_NoDocMode_Success.WriteLine(""hello""); |
Member
There was a problem hiding this comment.
This doesn't look right, aren't we trying to call Console.WriteLine here?
CyrusNajmabadi
commented
Jan 20, 2022
CyrusNajmabadi
commented
Jan 20, 2022
CyrusNajmabadi
commented
Jan 20, 2022
…mabadi/roslyn into metadataOnlyEmitXmlDocs
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Jan 21, 2022
* upstream/main: (1035 commits) Add missing header Mark IVSTypeScriptFormattingServiceImplementation as optional, but require it in the constructor Fix Go To Base for a symbol with a single metadata location (dotnet#58965) [EnC] Store entire spans instead of line deltas (dotnet#58831) Delete CodeAnalysisRules.ruleset (dotnet#58968) Allow xml docs to still be created when 'emit metadata only' is on. (dotnet#57667) Fix ParseVBErrorOrWarning (dotnet#47833) Update parameter nullability to match implementation Ensure CSharpUseParameterNullCheckingDiagnosticAnalyzer works with nullable parameters Add tests for issues fixed by previous PR (dotnet#58764) Update src/Features/CSharp/Portable/Completion/CompletionProviders/ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs Disallow null checking discard parameters (dotnet#58952) Add extension method Escape type arguments Few fixes Update tests. Add Analyzers layer to CODEOWNERS Add formatting analyzer test for param nullchecking (dotnet#58936) Move reading HideAdvancedMembers option up (dotnet#58747) List patterns: Slice value is assumed to be never null (dotnet#57457) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EmitMetadataOnly is a flag that exists for IDE scenarios to allow it to emit dlls cheaply that give hte top-level surface area of a particular compilation. This can then be used in cross-language scenarios to allow things like intellisense/QI/and-lots-more to work in a live fashion. We call these cross-language metadata-only dlls: 'skeleton assemblies'.
The IDE would like to improve our story around skeleton assemblies by being able to cache them to our persistence store so that later launched sessions of VS can reuse them without recomputing them.
This is generally not difficult for us to do except for one small snag. Specifically, one thing we support today with skeletons is being able to expose xml doc comments through the skeleton. This works by having us actually both emit the metadta-only-dll, but also creating a DocumentationProvider that wraps the original language compilation. So, for example, if VB references C#, it will get a dll for the C# metadata, but it will get a doc-provider that forwards along to the C# compilation to answer questions.
If we want to persist the dll (and still have xml-doc-comments work across languages) then we need to persist the xml doc info as well. This PR updates the compiler to support that. Previously, the compiler would completely skip xml doc generation if EmitMetadataOnly was set. With this PR, the compiler will emit xml doc comments as well if the appropriate stream is provided.
Relates to ref assemblies: #18612