Example #1
0
        private static Workspace OpenFolderWorkspace(string workspacePath, SourceFileMatcher fileMatcher)
        {
            var folderWorkspace = FolderWorkspace.Create();

            folderWorkspace.OpenFolder(workspacePath, fileMatcher);
            return(folderWorkspace);
        }
Example #2
0
        private static async Task <Workspace> OpenFolderWorkspaceAsync(string workspacePath, Matcher fileMatcher, CancellationToken cancellationToken)
        {
            var folderWorkspace = FolderWorkspace.Create();
            await folderWorkspace.OpenFolder(workspacePath, fileMatcher, cancellationToken).ConfigureAwait(false);

            return(folderWorkspace);
        }
Example #3
0
        private static async Task <Workspace> OpenWorkspaceAsync(
            string workspacePath,
            WorkspaceType workspaceType,
            ImmutableHashSet <string> filesToFormat,
            bool logWorkspaceWarnings,
            ILogger logger,
            CancellationToken cancellationToken)
        {
            if (workspaceType == WorkspaceType.Folder)
            {
                var folderWorkspace = FolderWorkspace.Create();
                await folderWorkspace.OpenFolder(workspacePath, filesToFormat, cancellationToken);

                return(folderWorkspace);
            }

            return(await OpenMSBuildWorkspaceAsync(workspacePath, workspaceType, logWorkspaceWarnings, logger, cancellationToken));
        }
Example #4
0
        private static async Task <Workspace?> OpenWorkspaceAsync(
            string workspacePath,
            WorkspaceType workspaceType,
            Matcher fileMatcher,
            bool logWorkspaceWarnings,
            ILogger logger,
            CancellationToken cancellationToken,
            bool createBinaryLog = false)
        {
            if (workspaceType == WorkspaceType.Folder)
            {
                var folderWorkspace = FolderWorkspace.Create();
                await folderWorkspace.OpenFolder(workspacePath, fileMatcher, cancellationToken);

                return(folderWorkspace);
            }

            return(await OpenMSBuildWorkspaceAsync(workspacePath, workspaceType, logWorkspaceWarnings, logger, cancellationToken, createBinaryLog));
        }