using Microsoft.CodeAnalysis; using System.Linq; namespace Semmle.Extraction { /// /// The scope of symbols in a source file. /// public class SourceScope : IExtractionScope { public SyntaxTree SourceTree { get; } public SourceScope(SyntaxTree tree) { SourceTree = tree; } public bool InFileScope(string path) => path == SourceTree.FilePath; public bool InScope(ISymbol symbol) => symbol.Locations.Any(loc => loc.SourceTree == SourceTree); } }