-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathLocationOrLocationLink.cs
37 lines (30 loc) · 1.09 KB
/
LocationOrLocationLink.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Newtonsoft.Json;
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization.Converters;
namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
{
[JsonConverter(typeof(LocationOrLocationLinkConverter))]
public struct LocationOrLocationLink {
public LocationOrLocationLink(Location location)
{
Location = location;
LocationLink = null;
}
public LocationOrLocationLink(LocationLink locationLink)
{
Location = null;
LocationLink = locationLink;
}
public bool IsLocation => Location != null;
public Location Location { get; }
public bool IsLocationLink => LocationLink != null;
public LocationLink LocationLink { get; }
public static implicit operator LocationOrLocationLink(Location location)
{
return new LocationOrLocationLink(location);
}
public static implicit operator LocationOrLocationLink(LocationLink locationLink)
{
return new LocationOrLocationLink(locationLink);
}
}
}