Skip to content

Commit 6520966

Browse files
committed
Add documentation to Workspace.GetOpenedFiles()
1 parent b9cfe1f commit 6520966

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/PowerShellEditorServices/Workspace/Workspace.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Microsoft.PowerShell.EditorServices.Utility;
77
using System;
88
using System.Collections.Generic;
9+
using System.Linq;
910
using System.IO;
1011
using System.Text;
1112

@@ -91,11 +92,13 @@ public ScriptFile GetFileBuffer(string filePath, string initialBuffer)
9192
return scriptFile;
9293
}
9394

95+
/// <summary>
96+
/// Gets an array of all opened ScriptFiles in the workspace.
97+
/// </summary>
98+
/// <returns>An array of all opened ScriptFiles in the workspace.</returns>
9499
public ScriptFile[] GetOpenedFiles()
95100
{
96-
var scriptFiles = new ScriptFile[workspaceFiles.Count];
97-
workspaceFiles.Values.CopyTo(scriptFiles, 0);
98-
return scriptFiles;
101+
return workspaceFiles.Values.ToArray();
99102
}
100103

101104
/// <summary>

0 commit comments

Comments
 (0)