private async Task MapSourcesAsync(IPackage package, string symbolFilePath, string symbolSourceUri) { var referencedSources = (await SymbolTools.GetSources(symbolFilePath)).ToList(); var sourceFiles = new HashSet <string>(package.GetFiles("src").Select(f => f.Path.Substring(4))); if (referencedSources.Any() && sourceFiles.Any()) { var sourceMapper = new SymbolSourceMapper(); var mappings = sourceMapper.CreateSourceMappingIndex(package, symbolSourceUri, referencedSources, sourceFiles); await SymbolTools.MapSourcesAsync(symbolFilePath, mappings); } }
public async Task ProcessSymbolFileAsync(IPackage package, string symbolFilePath, string symbolSourceUri) { var referencedSources = (await SymbolTools.GetSources(symbolFilePath)).ToList(); var sourceFiles = new HashSet<string>(package.GetFiles("src").Select(f => f.Path.Substring(4))); if (referencedSources.Any() && sourceFiles.Any()) { var sourceMapper = new SymbolSourceMapper(); var mappings = sourceMapper.CreateSourceMappingIndex(package, symbolSourceUri, referencedSources, sourceFiles); await SymbolTools.MapSourcesAsync(symbolFilePath, mappings); await SymbolTools.IndexSymbolFile(package, symbolFilePath); } }
public void FindSourceFile_Root(string referencedSource, string expected) { var result = new SymbolSourceMapper().FindSourceFile(referencedSource, sourceFiles); Assert.That(result, Is.EqualTo(expected).IgnoreCase, "For input \"" + referencedSource + "\""); }
public async Task ProcessSymbolFileAsync(IPackageName package, string symbolFilePath, string symbolSourceUri) { var referencedSources = (await SymbolTools.GetSources(symbolFilePath)).ToList(); var srcDir = Path.Combine(GetPackageSymbolPath(package), "src"); var sourceFiles = new HashSet<string>(Directory.EnumerateFiles(srcDir, "*", SearchOption.AllDirectories) .Select(s => s.Substring(srcDir.Length+1))); if (referencedSources.Any() && sourceFiles.Any()) { var sourceMapper = new SymbolSourceMapper(); var mappings = sourceMapper.CreateSourceMappingIndex(package, symbolSourceUri, referencedSources, sourceFiles); await SymbolTools.MapSourcesAsync(symbolFilePath, mappings); await SymbolTools.IndexSymbolFile(package, symbolFilePath); } }