File tree Expand file tree Collapse file tree
src/PowerShellEditorServices/Extensions
test/PowerShellEditorServices.Test/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Copyright (c) Microsoft Corporation.
22// Licensed under the MIT License.
33
4- using System . Collections . Generic ;
54using System . Linq ;
65
76namespace Microsoft . PowerShell . EditorServices . Extensions
@@ -85,9 +84,11 @@ public sealed class EditorWorkspace
8584 /// <summary>
8685 /// Get all currently open documents in the workspace.
8786 /// </summary>
88- public IEnumerable < EditorWorkspaceDocument > Documents => editorOperations
87+ public EditorWorkspaceDocument [ ] Documents => [ ..
88+ editorOperations
8989 . GetWorkspaceOpenDocuments ( )
90- . Select ( doc => new EditorWorkspaceDocument ( this , doc . Path , doc . Saved ) ) ;
90+ . Select ( doc => new EditorWorkspaceDocument ( this , doc . Path , doc . Saved ) )
91+ ] ;
9192
9293 #endregion
9394
Original file line number Diff line number Diff line change @@ -18,16 +18,16 @@ public void DocumentsReturnsOpenWorkspaceDocuments()
1818 {
1919 TestEditorOperations editorOperations = new ( )
2020 {
21- OpenDocuments = new [ ]
22- {
21+ OpenDocuments =
22+ [
2323 new WorkspaceOpenDocument ( @"C:\test\one.ps1" , saved : true ) ,
2424 new WorkspaceOpenDocument ( @"C:\test\two.ps1" , saved : true )
25- }
25+ ]
2626 } ;
2727
2828 EditorWorkspace workspace = new ( editorOperations ) ;
2929
30- IEnumerable < EditorWorkspaceDocument > documents = workspace . Documents ;
30+ EditorWorkspaceDocument [ ] documents = workspace . Documents ;
3131
3232 Assert . Collection (
3333 documents ,
@@ -49,7 +49,7 @@ public void DocumentOpenSaveAndCloseUseWorkspaceOperations()
4949 const string filePath = @"C:\test\file.ps1" ;
5050 TestEditorOperations editorOperations = new ( )
5151 {
52- OpenDocuments = new [ ] { new WorkspaceOpenDocument ( filePath , saved : true ) }
52+ OpenDocuments = [ new WorkspaceOpenDocument ( filePath , saved : true ) ]
5353 } ;
5454
5555 EditorWorkspace workspace = new ( editorOperations ) ;
You can’t perform that action at this time.
0 commit comments