MLLIF
a MLIR-based Language to Language Interoperability Flyover
Loading...
Searching...
No Matches
DocumentExtension.cs
Go to the documentation of this file.
1using Microsoft.CodeAnalysis;
2
4
5public static class DocumentExtension
6{
7 public static Document? GetDocument(this Project project, ISymbol symbol)
8 {
9 var syntax = symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax();
10 return syntax is null ? null : project.GetDocument(syntax.SyntaxTree);
11 }
12}
Microsoft.CodeAnalysis.Project Project
Definition Program.cs:6