Skip to content

Commit 87b6613

Browse files
Added some additional helpers for both Range and Position (#410)
* Added some additional helpers for both Range and Position to make usage easier * Added TestContent helper for helping to test source code
1 parent 300ef94 commit 87b6613

13 files changed

+2502
-5
lines changed

package-lock.json

Lines changed: 1190 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
2+
{
3+
public partial class Position
4+
{
5+
/// <summary>
6+
/// Derive a new position from this position.
7+
/// </summary>
8+
public Position Delta(int deltaLine = 0, int deltaCharacter = 0)
9+
{
10+
return new Position(Line + deltaLine, Character + deltaCharacter);
11+
}
12+
}
13+
}

src/Protocol/Models/Position.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
66
{
77
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")]
8-
public class Position : IEquatable<Position>, IComparable<Position>, IComparable
8+
public partial class Position : IEquatable<Position>, IComparable<Position>, IComparable
99
{
1010
public Position()
1111
{

0 commit comments

Comments
 (0)