Skip to content

Commit b68b420

Browse files
committed
Adding documentation for EditorWindow API methods
1 parent 2f07d90 commit b68b420

File tree

4 files changed

+41
-35
lines changed

4 files changed

+41
-35
lines changed

src/PowerShellEditorServices/Extensions/EditorWindow.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ public class EditorWindow
1919

2020
#region Constructors
2121

22+
/// <summary>
23+
/// Creates a new instance of the EditorWindow class.
24+
/// </summary>
25+
/// <param name="editorOperations">An IEditorOperations implementation which handles operations in the host editor.</param>
2226
internal EditorWindow(IEditorOperations editorOperations)
2327
{
2428
this.editorOperations = editorOperations;
@@ -27,37 +31,38 @@ internal EditorWindow(IEditorOperations editorOperations)
2731
#endregion
2832

2933
#region Public Methods
34+
3035
/// <summary>
31-
///
36+
/// Shows an informational message to the user.
3237
/// </summary>
33-
/// <param name="message"></param>
38+
/// <param name="message">The message to be shown.</param>
3439
public void ShowInformationMessage(string message)
3540
{
3641
this.editorOperations.ShowInformationMessage(message).Wait();
3742
}
3843

3944
/// <summary>
40-
///
45+
/// Shows an error message to the user.
4146
/// </summary>
42-
/// <param name="message"></param>
47+
/// <param name="message">The message to be shown.</param>
4348
public void ShowErrorMessage(string message)
4449
{
4550
this.editorOperations.ShowErrorMessage(message).Wait();
4651
}
4752

4853
/// <summary>
49-
///
54+
/// Shows a warning message to the user.
5055
/// </summary>
51-
/// <param name="message"></param>
56+
/// <param name="message">The message to be shown.</param>
5257
public void ShowWarningMessage(string message)
5358
{
5459
this.editorOperations.ShowWarningMessage(message).Wait();
5560
}
5661

5762
/// <summary>
58-
///
63+
/// Sets the status bar message in the editor UI (if applicable).
5964
/// </summary>
60-
/// <param name="message"></param>
65+
/// <param name="message">The message to be shown.</param>
6166
public void SetStatusBarMessage(string message)
6267
{
6368
this.editorOperations.SetStatusBarMessage(message).Wait();

src/PowerShellEditorServices/Extensions/IEditorOperations.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,31 @@ public interface IEditorOperations
4545
Task SetSelection(BufferRange selectionRange);
4646

4747
/// <summary>
48-
///
48+
/// Shows an informational message to the user.
4949
/// </summary>
50-
/// <param name="message"></param>
51-
/// <returns></returns>
50+
/// <param name="message">The message to be shown.</param>
51+
/// <returns>A Task that can be tracked for completion.</returns>
5252
Task ShowInformationMessage(string message);
5353

5454
/// <summary>
55-
///
55+
/// Shows an error message to the user.
5656
/// </summary>
57-
/// <param name="message"></param>
58-
/// <returns></returns>
57+
/// <param name="message">The message to be shown.</param>
58+
/// <returns>A Task that can be tracked for completion.</returns>
5959
Task ShowErrorMessage(string message);
6060

6161
/// <summary>
62-
///
62+
/// Shows a warning message to the user.
6363
/// </summary>
64-
/// <param name="message"></param>
65-
/// <returns></returns>
64+
/// <param name="message">The message to be shown.</param>
65+
/// <returns>A Task that can be tracked for completion.</returns>
6666
Task ShowWarningMessage(string message);
6767

6868
/// <summary>
69-
///
69+
/// Sets the status bar message in the editor UI (if applicable).
7070
/// </summary>
71-
/// <param name="message"></param>
72-
/// <returns></returns>
71+
/// <param name="message">The message to be shown.</param>
72+
/// <returns>A Task that can be tracked for completion.</returns>
7373
Task SetStatusBarMessage(string message);
7474
}
7575
}

src/PowerShellEditorServices/Nano.PowerShellEditorServices.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
<Compile Include="Debugging\VariableContainerDetails.cs" />
6060
<Compile Include="Extensions\EditorContext.cs" />
6161
<Compile Include="Extensions\EditorObject.cs" />
62+
<Compile Include="Extensions\EditorWindow.cs" />
6263
<Compile Include="Extensions\EditorWorkspace.cs" />
6364
<Compile Include="Extensions\EditorCommand.cs" />
6465
<Compile Include="Extensions\ExtensionService.cs" />

src/PowerShellEditorServices/Workspace/ScriptFile.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -499,26 +499,26 @@ private void ParseFileContents()
499499
{
500500
#if PowerShellv5r2
501501
// This overload appeared with Windows 10 Update 1
502-
//if (this.powerShellVersion.Major >= 5 &&
503-
// this.powerShellVersion.Build >= 10586)
504-
//{
505-
// // Include the file path so that module relative
506-
// // paths are evaluated correctly
507-
// this.ScriptAst =
508-
// Parser.ParseInput(
509-
// this.Contents,
510-
// this.FilePath,
511-
// out this.scriptTokens,
512-
// out parseErrors);
513-
//}
514-
//else
515-
//{
502+
if (this.powerShellVersion.Major >= 5 &&
503+
this.powerShellVersion.Build >= 10586)
504+
{
505+
// Include the file path so that module relative
506+
// paths are evaluated correctly
507+
this.ScriptAst =
508+
Parser.ParseInput(
509+
this.Contents,
510+
this.FilePath,
511+
out this.scriptTokens,
512+
out parseErrors);
513+
}
514+
else
515+
{
516516
this.ScriptAst =
517517
Parser.ParseInput(
518518
this.Contents,
519519
out this.scriptTokens,
520520
out parseErrors);
521-
//}
521+
}
522522
#else
523523
this.ScriptAst =
524524
Parser.ParseInput(

0 commit comments

Comments
 (0)