private static Workspace OpenFolderWorkspace(string workspacePath, SourceFileMatcher fileMatcher) { var folderWorkspace = FolderWorkspace.Create(); folderWorkspace.OpenFolder(workspacePath, fileMatcher); return(folderWorkspace); }
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); }
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)); }
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)); }