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

            folderWorkspace.OpenFolder(workspacePath, fileMatcher);
            return(folderWorkspace);
        }
예제 #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);
        }
예제 #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));
        }
예제 #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));
        }