-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathLanguageServerOptions.cs
121 lines (88 loc) · 7.58 KB
/
LanguageServerOptions.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using System;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using OmniSharp.Extensions.JsonRpc;
using OmniSharp.Extensions.LanguageServer.Protocol;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
namespace OmniSharp.Extensions.LanguageServer.Server
{
public class LanguageServerOptions : LanguageProtocolRpcOptionsBase<LanguageServerOptions>, ILanguageServerRegistry
{
public ServerInfo ServerInfo { get; set; }
public ILspServerReceiver Receiver { get; set; } = new LspServerReceiver();
public LanguageServerOptions WithReceiver(ILspServerReceiver receiver)
{
Receiver = receiver;
return this;
}
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandler(string method, IJsonRpcHandler handler, JsonRpcHandlerOptions options) =>
AddHandler(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandler(string method, JsonRpcHandlerFactory handlerFunc, JsonRpcHandlerOptions options) =>
AddHandler(method, handlerFunc, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandlers(params IJsonRpcHandler[] handlers) => AddHandlers(handlers);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandler(JsonRpcHandlerFactory handlerFunc, JsonRpcHandlerOptions options) =>
AddHandler(handlerFunc, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandler(IJsonRpcHandler handler, JsonRpcHandlerOptions options) => AddHandler(handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandler<TTHandler>(JsonRpcHandlerOptions options) => AddHandler<TTHandler>(options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandler<TTHandler>(string method, JsonRpcHandlerOptions options) =>
AddHandler<TTHandler>(method, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandler(Type type, JsonRpcHandlerOptions options) => AddHandler(type, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandler(string method, Type type, JsonRpcHandlerOptions options) =>
AddHandler(method, type, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.AddHandlerLink(string sourceMethod, string destinationMethod) =>
AddHandlerLink(sourceMethod, destinationMethod);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnJsonRequest(string method, Func<JToken, Task<JToken>> handler, JsonRpcHandlerOptions options) =>
OnJsonRequest(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnJsonRequest(
string method, Func<JToken, CancellationToken, Task<JToken>> handler, JsonRpcHandlerOptions options
) => OnJsonRequest(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnRequest<TParams, TResponse>(
string method, Func<TParams, Task<TResponse>> handler, JsonRpcHandlerOptions options
) => OnRequest(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnRequest<TParams, TResponse>(
string method, Func<TParams, CancellationToken, Task<TResponse>> handler, JsonRpcHandlerOptions options
) => OnRequest(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.
OnRequest<TResponse>(string method, Func<Task<TResponse>> handler, JsonRpcHandlerOptions options) => OnRequest(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnRequest<TResponse>(
string method, Func<CancellationToken, Task<TResponse>> handler, JsonRpcHandlerOptions options
) => OnRequest(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnRequest<TParams>(string method, Func<TParams, Task> handler, JsonRpcHandlerOptions options) =>
OnRequest(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnRequest<TParams>(
string method, Func<TParams, CancellationToken, Task> handler, JsonRpcHandlerOptions options
) => OnRequest(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnRequest<TParams>(
string method, Func<CancellationToken, Task> handler, JsonRpcHandlerOptions options
) => OnRequest<TParams>(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnNotification<TParams>(
string method, Action<TParams, CancellationToken> handler, JsonRpcHandlerOptions options
) => OnNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnJsonNotification(string method, Action<JToken> handler, JsonRpcHandlerOptions options) =>
OnJsonNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnJsonNotification(
string method, Func<JToken, CancellationToken, Task> handler, JsonRpcHandlerOptions options
) => OnJsonNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnJsonNotification(string method, Func<JToken, Task> handler, JsonRpcHandlerOptions options) =>
OnJsonNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnJsonNotification(
string method, Action<JToken, CancellationToken> handler, JsonRpcHandlerOptions options
) => OnJsonNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnNotification<TParams>(string method, Action<TParams> handler, JsonRpcHandlerOptions options) =>
OnNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnNotification<TParams>(
string method, Func<TParams, CancellationToken, Task> handler, JsonRpcHandlerOptions options
) => OnNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.
OnNotification<TParams>(string method, Func<TParams, Task> handler, JsonRpcHandlerOptions options) => OnNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnNotification(string method, Action handler, JsonRpcHandlerOptions options) =>
OnNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.
OnNotification(string method, Func<CancellationToken, Task> handler, JsonRpcHandlerOptions options) => OnNotification(method, handler, options);
ILanguageServerRegistry IJsonRpcHandlerRegistry<ILanguageServerRegistry>.OnNotification(string method, Func<Task> handler, JsonRpcHandlerOptions options) =>
OnNotification(method, handler, options);
public override IRequestProcessIdentifier RequestProcessIdentifier { get; set; }
}
}