예제 #1
0
        private async Task BuildFileCommitsByMemberAsync()
        {
            foreach (FileCommit commit in FindCommits())
            {
                switch (commit.ChangeType)
                {
                case FileChangeType.Added:
                    SolutionWithSyntax newText = GetNewText(commit);
                    await newText.AcceptAsync(new MemberListBuilder(commit, AddFileCommit));

                    sourceTextByFileName[commit.Name] = newText;
                    break;

                case FileChangeType.Modified:
                    foreach (AbstractSyntaxNode member in await FindChangesAsync(commit))
                    {
                        AddFileCommit(member, commit);
                    }

                    break;

                case FileChangeType.Deleted:
                    await GetOldText(commit).AcceptAsync(new MemberListBuilder(commit, AddFileCommit));

                    break;
                }
            }
        }
예제 #2
0
        private Task <IEnumerable <AbstractSyntaxNode> > FindChangesAsync(FileCommit commit)
        {
            SolutionWithSyntax oldText = GetOldText(commit);
            SolutionWithSyntax newText = GetNewText(commit);

            sourceTextByFileName[commit.Name] = newText;
            return(ChangeFinder.FindChangesForSingleDocumentSolutionAsync(oldText, newText));
        }
예제 #3
0
        private SolutionWithSyntax GetNewText(FileCommit commit)
        {
            string text = repository.FindFileAtRevision(commit.Name, commit.Commit.CommitId);

            return(SolutionWithSyntax.CreateSolutionForText(text));
        }