7
7
using System . Linq ;
8
8
using System . Reflection ;
9
9
using System . Threading ;
10
+ using JsonRpc . Dataflow ;
10
11
using JsonRpc . Standard . Client ;
11
12
using JsonRpc . Standard . Contracts ;
12
- using JsonRpc . Standard . Dataflow ;
13
13
using JsonRpc . Standard . Server ;
14
14
using LanguageServer . VsCode ;
15
15
using Microsoft . Extensions . Logging ;
@@ -79,16 +79,14 @@ static void Main(string[] args)
79
79
}
80
80
}
81
81
82
- private static IJsonRpcServiceHost BuildServiceHost ( ISession session , TextWriter logWriter ,
82
+ private static DataflowRpcServiceHost BuildServiceHost ( LanguageServerSession session , TextWriter logWriter ,
83
83
IJsonRpcContractResolver contractResolver , bool debugMode )
84
84
{
85
85
var loggerFactory = new LoggerFactory ( ) ;
86
86
loggerFactory . AddProvider ( new DebugLoggerProvider ( null ) ) ;
87
- var builder = new ServiceHostBuilder
87
+ var builder = new JsonRpcServiceHostBuilder
88
88
{
89
89
ContractResolver = contractResolver ,
90
- Session = session ,
91
- Options = JsonRpcServiceHostOptions . ConsistentResponseSequence ,
92
90
LoggerFactory = loggerFactory
93
91
} ;
94
92
builder . UseCancellationHandling ( ) ;
@@ -103,7 +101,12 @@ private static IJsonRpcServiceHost BuildServiceHost(ISession session, TextWriter
103
101
lock ( logWriter ) logWriter . WriteLine ( "< {0}" , context . Response ) ;
104
102
} ) ;
105
103
}
106
- return builder . Build ( ) ;
104
+ var host = builder . Build ( ) ;
105
+ var features = new FeatureCollection ( ) ;
106
+ features . Set ( session ) ;
107
+ return new DataflowRpcServiceHost ( host , features ,
108
+ DataflowRpcServiceHostOptions . ConsistentResponseSequence |
109
+ DataflowRpcServiceHostOptions . SupportsRequestCancellation ) ;
107
110
}
108
111
109
112
}
0 commit comments