File tree Expand file tree Collapse file tree 5 files changed +77
-45
lines changed
PowerShellEditorServices.Protocol/LanguageServer Expand file tree Collapse file tree 5 files changed +77
-45
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ public static readonly
107
107
RequestType < string , EditorCommandResponse > Type =
108
108
RequestType < string , EditorCommandResponse > . Create ( "editor/openFile" ) ;
109
109
}
110
+
110
111
public class ShowInformationMessageRequest
111
112
{
112
113
public static readonly
Original file line number Diff line number Diff line change @@ -109,50 +109,6 @@ public void SetSelection(BufferRange selectionRange)
109
109
. Wait ( ) ;
110
110
}
111
111
112
- /// <summary>
113
- ///
114
- /// </summary>
115
- /// <param name="message"></param>
116
- public void ShowInformationMessage ( string message )
117
- {
118
- this . editorOperations
119
- . ShowInformationMessage ( message )
120
- . Wait ( ) ;
121
- }
122
-
123
- /// <summary>
124
- ///
125
- /// </summary>
126
- /// <param name="message"></param>
127
- public void ShowErrorMessage ( string message )
128
- {
129
- this . editorOperations
130
- . ShowErrorMessage ( message )
131
- . Wait ( ) ;
132
- }
133
-
134
- /// <summary>
135
- ///
136
- /// </summary>
137
- /// <param name="message"></param>
138
- public void ShowWarningMessage ( string message )
139
- {
140
- this . editorOperations
141
- . ShowWarningMessage ( message )
142
- . Wait ( ) ;
143
- }
144
-
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
-
156
112
#endregion
157
113
}
158
114
}
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ public Version EditorServicesVersion
37
37
/// </summary>
38
38
public EditorWorkspace Workspace { get ; private set ; }
39
39
40
+ /// <summary>
41
+ /// Gets the window interface for the editor API.
42
+ /// </summary>
43
+ public EditorWindow Window { get ; private set ; }
44
+
40
45
#endregion
41
46
42
47
/// <summary>
@@ -53,6 +58,7 @@ public EditorObject(
53
58
54
59
// Create API area objects
55
60
this . Workspace = new EditorWorkspace ( this . editorOperations ) ;
61
+ this . Window = new EditorWindow ( this . editorOperations ) ;
56
62
}
57
63
58
64
/// <summary>
@@ -82,7 +88,7 @@ public void UnregisterCommand(string commandName)
82
88
public EditorContext GetEditorContext ( )
83
89
{
84
90
return this . editorOperations . GetEditorContext ( ) . Result ;
85
- }
91
+ }
86
92
}
87
93
}
88
94
Original file line number Diff line number Diff line change
1
+ //
2
+ // Copyright (c) Microsoft. All rights reserved.
3
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
4
+ //
5
+
6
+ namespace Microsoft . PowerShell . EditorServices . Extensions
7
+ {
8
+ /// <summary>
9
+ /// Provides a PowerShell-facing API which allows scripts to
10
+ /// interact with the editor's window.
11
+ /// </summary>
12
+ public class EditorWindow
13
+ {
14
+ #region Private Fields
15
+
16
+ private IEditorOperations editorOperations ;
17
+
18
+ #endregion
19
+
20
+ #region Constructors
21
+
22
+ internal EditorWindow ( IEditorOperations editorOperations )
23
+ {
24
+ this . editorOperations = editorOperations ;
25
+ }
26
+
27
+ #endregion
28
+
29
+ #region Public Methods
30
+ /// <summary>
31
+ ///
32
+ /// </summary>
33
+ /// <param name="message"></param>
34
+ public void ShowInformationMessage ( string message )
35
+ {
36
+ this . editorOperations . ShowInformationMessage ( message ) . Wait ( ) ;
37
+ }
38
+
39
+ /// <summary>
40
+ ///
41
+ /// </summary>
42
+ /// <param name="message"></param>
43
+ public void ShowErrorMessage ( string message )
44
+ {
45
+ this . editorOperations . ShowErrorMessage ( message ) . Wait ( ) ;
46
+ }
47
+
48
+ /// <summary>
49
+ ///
50
+ /// </summary>
51
+ /// <param name="message"></param>
52
+ public void ShowWarningMessage ( string message )
53
+ {
54
+ this . editorOperations . ShowWarningMessage ( message ) . Wait ( ) ;
55
+ }
56
+
57
+ /// <summary>
58
+ ///
59
+ /// </summary>
60
+ /// <param name="message"></param>
61
+ public void SetStatusBarMessage ( string message )
62
+ {
63
+ this . editorOperations . SetStatusBarMessage ( message ) . Wait ( ) ;
64
+ }
65
+
66
+ #endregion
67
+ }
68
+ }
Original file line number Diff line number Diff line change 79
79
<Compile Include =" Debugging\VariableContainerDetails.cs" />
80
80
<Compile Include =" Extensions\EditorContext.cs" />
81
81
<Compile Include =" Extensions\EditorObject.cs" />
82
+ <Compile Include =" Extensions\EditorWindow.cs" />
82
83
<Compile Include =" Extensions\EditorWorkspace.cs" />
83
84
<Compile Include =" Extensions\EditorCommand.cs" />
84
85
<Compile Include =" Extensions\ExtensionService.cs" />
You can’t perform that action at this time.
0 commit comments