Skip to content

Commit 9f6316b

Browse files
dfinkedaviwil
authored andcommitted
Wired in setStatusBarMessage
1 parent 52fcf03 commit 9f6316b

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

src/PowerShellEditorServices.Protocol/LanguageServer/EditorCommands.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,12 @@ public static readonly
127127
RequestType<string, EditorCommandResponse> Type =
128128
RequestType<string, EditorCommandResponse>.Create("editor/showErrorMessage");
129129
}
130+
131+
public class SetStatusBarMessageRequest
132+
{
133+
public static readonly
134+
RequestType<string, EditorCommandResponse> Type =
135+
RequestType<string, EditorCommandResponse>.Create("editor/setStatusBarMessage");
136+
}
130137
}
131138

src/PowerShellEditorServices.Protocol/Server/LanguageServerEditorOperations.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
88
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
99
using System.Threading.Tasks;
10+
using System;
1011

1112
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
1213
{
@@ -135,7 +136,15 @@ public Task ShowWarningMessage(string message)
135136
ShowWarningMessageRequest.Type,
136137
message,
137138
true);
139+
}
138140

141+
public Task SetStatusBarMessage(string message)
142+
{
143+
return
144+
this.messageSender.SendRequest(
145+
SetStatusBarMessageRequest.Type,
146+
message,
147+
true);
139148
}
140149
}
141150
}

src/PowerShellEditorServices/Extensions/EditorContext.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,17 @@ public void ShowWarningMessage(string message)
142142
.Wait();
143143
}
144144

145+
/// <summary>
146+
///
147+
/// </summary>
148+
/// <param name="message"></param>
149+
public void SetStatusBarMessage(string message)
150+
{
151+
this.editorOperations
152+
.SetStatusBarMessage(message)
153+
.Wait();
154+
}
155+
145156
#endregion
146157
}
147158
}

src/PowerShellEditorServices/Extensions/IEditorOperations.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ public interface IEditorOperations
6464
/// <param name="message"></param>
6565
/// <returns></returns>
6666
Task ShowWarningMessage(string message);
67+
68+
/// <summary>
69+
///
70+
/// </summary>
71+
/// <param name="message"></param>
72+
/// <returns></returns>
73+
Task SetStatusBarMessage(string message);
6774
}
6875
}
6976

test/PowerShellEditorServices.Test/Extensions/ExtensionServiceTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ public Task ShowWarningMessage(string message)
202202
{
203203
throw new NotImplementedException();
204204
}
205+
206+
public Task SetStatusBarMessage(string message)
207+
{
208+
throw new NotImplementedException();
209+
}
205210
}
206211
}
207212

0 commit comments

Comments
 (0)