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

            folderWorkspace.OpenFolder(workspacePath, fileMatcher);
            return(folderWorkspace);
        }
コード例 #2
0
ファイル: CodeFormatter.cs プロジェクト: vdurante/format
        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));
        }