Skip to content

Commit 4f39d7d

Browse files
Kapil Borledaviwil
authored andcommitted
Add registration options for didSave notification
1 parent a113d32 commit 4f39d7d

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/PowerShellEditorServices.Protocol/LanguageServer/TextDocument.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,28 @@ public class DidCloseTextDocumentParams
167167
public class DidSaveTextDocumentNotification
168168
{
169169
public static readonly
170-
NotificationType<DidSaveTextDocumentParams, object> Type =
171-
NotificationType<DidSaveTextDocumentParams, object>.Create("textDocument/didSave");
170+
NotificationType<DidSaveTextDocumentParams, TextDocumentSaveRegistrationOptions> Type =
171+
NotificationType<DidSaveTextDocumentParams, TextDocumentSaveRegistrationOptions>.Create("textDocument/didSave");
172+
}
173+
174+
/// <summary>
175+
/// Save options.
176+
/// </summary>
177+
public class SaveOptions {
178+
/// <summary>
179+
/// The client is supposed to include the content on save.
180+
/// </summary>
181+
public bool? IncludeText { get; set; }
182+
}
183+
184+
public class TextDocumentSaveRegistrationOptions : TextDocumentRegistrationOptions
185+
{
186+
// We cannot inherit from two base classes (SaveOptions and TextDocumentRegistrationOptions)
187+
// simultaneously, hence we repeat this IncludeText flag here.
188+
/// <summary>
189+
/// The client is supposed to include the content on save.
190+
/// </summary>
191+
public bool? IncludeText { get; set; }
172192
}
173193

174194
/// <summary>

0 commit comments

Comments
 (0)