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); }
public RenameDocumentCodeAction(RenameDocumentCodeActionContext fixContext) { _fixContext = fixContext; _name = fixContext.Name; }