internal async static Task <bool> ApplyDocumentChangesAsync(Document document) { if (document == null) { return(false); } VisualStudioWorkspace workspace = await GetVisualStudioWorkspaceAsync(); Solution newSolution = document.Project.Solution; if (workspace.CanApplyChange(ApplyChangesKind.ChangeDocument)) { return(workspace.TryApplyChanges(newSolution)); } return(false); }