Skip to content

Commit bfe5f1c

Browse files
fix rename file to use DocumentUri instead of string (#270)
* fix rename file to use DocumentUri instead of string * Updated versioned identifier
1 parent 00dafaa commit bfe5f1c

7 files changed

+8
-9
lines changed

src/Protocol/Models/PublishDiagnosticsParams.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class PublishDiagnosticsParams : IRequest
1818
/// @since 3.15.0
1919
/// </summary>
2020
[Optional]
21-
public long Version { get; set; }
21+
public int? Version { get; set; }
2222

2323
/// <summary>
2424
/// An array of diagnostic information items.

src/Protocol/Models/RenameFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public class RenameFile : IFile
1414
/// <summary>
1515
/// The old (existing) location.
1616
/// </summary>
17-
public string OldUri { get; set; }
17+
public DocumentUri OldUri { get; set; }
1818
/// <summary>
1919
/// The new location.
2020
/// </summary>
21-
public string NewUri { get; set; }
21+
public DocumentUri NewUri { get; set; }
2222
/// <summary>
2323
/// Rename Options.
2424
/// </summary>

src/Protocol/Models/TextDocumentItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class TextDocumentItem : TextDocumentIdentifier
1414
/// The version number of this document (it will strictly increase after each
1515
/// change, including undo/redo).
1616
/// </summary>
17-
public long Version { get; set; }
17+
public int? Version { get; set; }
1818

1919
/// <summary>
2020
/// The content of the opened text document.

src/Protocol/Models/VersionedTextDocumentIdentifier.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public override int GetHashCode()
3636
/// <summary>
3737
/// The version number of this document.
3838
/// </summary>
39-
public long Version { get; set; }
39+
public int? Version { get; set; }
4040

41-
private string DebuggerDisplay => $"({Version}) {Uri}";
41+
private string DebuggerDisplay => $"{Uri}@({Version})";
4242
/// <inheritdoc />
4343
public override string ToString() => DebuggerDisplay;
4444
}

test/Lsp.Tests/Models/DidChangeTextDocumentParamsTests_$NonStandardCharactersTest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"textDocument": {
3-
"version": 0,
3+
"version": null,
44
"uri": "file:///c:/abc/M%C3%B6rk%C3%B6.cs"
55
},
66
"contentChanges": [

test/Lsp.Tests/Models/DidChangeTextDocumentParamsTests_$SimpleTest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"textDocument": {
3-
"version": 0,
3+
"version": null,
44
"uri": "file:///somepath/to/a/file.ext"
55
},
66
"contentChanges": [

test/Lsp.Tests/Models/PublishDiagnosticsParamsTests_$SimpleTest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"uri": "file:///abc/123.cs",
3-
"version": 0,
43
"diagnostics": [
54
{
65
"range": {

0 commit comments

Comments
 (0)