예제 #1
0
        private static async Task <Solution> RenameDocumentToFolderAsync(RenameDocumentCodeActionContext context, CancellationToken cancellationToken)
        {
            var solution  = context.Solution;
            var document  = solution.GetDocument(context.DocumentId);
            var projectId = document.Project.Id;

            solution = solution.RemoveDocument(context.DocumentId);
            solution = solution.AddDocument(DocumentId.CreateNewId(projectId), $"{context.Name}.cs", await document.GetTextAsync(cancellationToken), document.Folders);
            return(solution);
        }
예제 #2
0
 public RenameDocumentCodeAction(RenameDocumentCodeActionContext fixContext)
 {
     _fixContext = fixContext;
     _name       = fixContext.Name;
 }