Skip to content

Commit

Permalink
fix rename file to use DocumentUri instead of string (#270)
Browse files Browse the repository at this point in the history
* fix rename file to use DocumentUri instead of string
* Updated versioned identifier
  • Loading branch information
david-driscoll authored Aug 1, 2020
1 parent 00dafaa commit bfe5f1c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Protocol/Models/PublishDiagnosticsParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class PublishDiagnosticsParams : IRequest
/// @since 3.15.0
/// </summary>
[Optional]
public long Version { get; set; }
public int? Version { get; set; }

/// <summary>
/// An array of diagnostic information items.
Expand Down
4 changes: 2 additions & 2 deletions src/Protocol/Models/RenameFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public class RenameFile : IFile
/// <summary>
/// The old (existing) location.
/// </summary>
public string OldUri { get; set; }
public DocumentUri OldUri { get; set; }
/// <summary>
/// The new location.
/// </summary>
public string NewUri { get; set; }
public DocumentUri NewUri { get; set; }
/// <summary>
/// Rename Options.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Protocol/Models/TextDocumentItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TextDocumentItem : TextDocumentIdentifier
/// The version number of this document (it will strictly increase after each
/// change, including undo/redo).
/// </summary>
public long Version { get; set; }
public int? Version { get; set; }

/// <summary>
/// The content of the opened text document.
Expand Down
4 changes: 2 additions & 2 deletions src/Protocol/Models/VersionedTextDocumentIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public override int GetHashCode()
/// <summary>
/// The version number of this document.
/// </summary>
public long Version { get; set; }
public int? Version { get; set; }

private string DebuggerDisplay => $"({Version}) {Uri}";
private string DebuggerDisplay => $"{Uri}@({Version})";
/// <inheritdoc />
public override string ToString() => DebuggerDisplay;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"textDocument": {
"version": 0,
"version": null,
"uri": "file:///c:/abc/M%C3%B6rk%C3%B6.cs"
},
"contentChanges": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"textDocument": {
"version": 0,
"version": null,
"uri": "file:///somepath/to/a/file.ext"
},
"contentChanges": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"uri": "file:///abc/123.cs",
"version": 0,
"diagnostics": [
{
"range": {
Expand Down

0 comments on commit bfe5f1c

Please sign in to comment.