Skip to content

Commit eee2324

Browse files
added missing WorkspaceEdit.DocumentChanges and TextDocumentEdit Models.
1 parent 61e6b06 commit eee2324

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

src/Lsp/Models/TextDocumentEdit.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Newtonsoft.Json;
2+
using Newtonsoft.Json.Serialization;
3+
4+
namespace OmniSharp.Extensions.LanguageServer.Models
5+
{
6+
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
7+
public class TextDocumentEdit
8+
{
9+
/// <summary>
10+
/// The text document to change.
11+
/// </summary>
12+
public VersionedTextDocumentIdentifier TextDocument { get; set; }
13+
14+
/// <summary>
15+
/// The edits to be applied.
16+
/// </summary>
17+
public Container<TextEdit> Edits { get; set; }
18+
}
19+
}

src/Lsp/Models/WorkspaceEdit.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ public class WorkspaceEdit
1111
/// <summary>
1212
/// Holds changes to existing resources.
1313
/// </summary>
14-
public IDictionary<Uri, IEnumerable<TextEdit>> Changes { get; set; } = new Dictionary<Uri, IEnumerable<TextEdit>>();
14+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
15+
public IDictionary<Uri, IEnumerable<TextEdit>> Changes { get; set; }
16+
/// <summary>
17+
/// An array of `TextDocumentEdit`s to express changes to n different text documents
18+
/// where each text document edit addresses a specific version of a text document.
19+
/// Whether a client supports versioned document edits is expressed via
20+
/// `WorkspaceClientCapabilities.workspaceEdit.documentChanges`.
21+
/// </summary>
22+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
23+
public Container<TextDocumentEdit> DocumentChanges { get; set; }
1524
}
16-
}
25+
}

0 commit comments

Comments
 (0)