private void AddDocumentInternal(string documentPath, string content, Encoding encoding, Project project)
        {
            var sourceText = SourceText.From(content, encoding ?? Encoding.UTF8);
            var doc        = project.AddDocument(documentPath, sourceText);

            // Get the new Workspace.
            _solution = doc.Project.Solution;
        }
        private WorkspaceManager(RoslynWorkspace workSpace, string rootProjectPath)
        {
            if (workSpace == null)
            {
                throw new ArgumentNullException(nameof(workSpace));
            }

            if (string.IsNullOrEmpty(rootProjectPath))
            {
                throw new ArgumentException(nameof(rootProjectPath));
            }

            _solution        = workSpace.CurrentSolution;
            _rootProjectPath = rootProjectPath;
        }