You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I need to extract Xml documentation from all ISymbols. For this, I run this code to create a Roslyn Project and start its analysis:
AnalyzerManager manager = new AnalyzerManager();
IProjectAnalyzer analyzer = manager.GetProject(projectPath);
AdhocWorkspace workspace = new AdhocWorkspace();
Project project = analyzer.AddToWorkspace(workspace);
Compilation compilation = project.GetCompilationAsync().Result;
// ... For each document in project.Documents
var syntaxTree = document.GetSyntaxTreeAsync().Result;
var semanticModel = compilation.GetSemanticModel(syntaxTree, true);
// ... Get some symbol from syntaxtree using semanticmodel and extract Xml
var xml = symbol.GetDocumentationCommentXml(expandIncludes: true);
I can normally obtain Xml documentation for symbols declared inside the project.
However, no documentation is available for symbols loaded from imported packages. For example, if my analyser meets List symbol, it does not have Xml comment despite it is imported properly in analysed code.
Could you please advise do I miss anything in my code or maybe my Project loading stage is wrong?
The text was updated successfully, but these errors were encountered:
I am able to receive Xml-comments from the project's code itself. For example, if I run analysis of some project, the documentation of its classes and methods will be loaded normally. However, this project also uses some classes from referenced packages, for example, List class - its Xml documentation is missing.
Hello @vladimirKa002, I believe I understand what you mean, I was curious and did some local tests, I really didn't find a way that works.
Looking at swashbuckle it seems to me (I'm not sure) that it works because it reads the XML file from the repository, it would be an alternative to a "controlled" external reference where you have access to the XML, but you would have to code something to do this.
I found this discussion that seems to be the same topic we are talking about here.
Hello. I need to extract Xml documentation from all
ISymbols
. For this, I run this code to create a Roslyn Project and start its analysis:I can normally obtain Xml documentation for symbols declared inside the project.
However, no documentation is available for symbols loaded from imported packages. For example, if my analyser meets
List
symbol, it does not have Xml comment despite it is imported properly in analysed code.Could you please advise do I miss anything in my code or maybe my Project loading stage is wrong?
The text was updated successfully, but these errors were encountered: