@@ -110,11 +110,13 @@ void processNotify(RequestMessage msg)
110
110
served.extension.shutdown();
111
111
return ;
112
112
}
113
- if (msg.method == " workspace/didChangeConfiguration " )
113
+ if (! initialized )
114
114
{
115
- auto newConfig = msg.params[ " settings " ].fromJSON ! Configuration ;
116
- served.extension.changedConfig(served.types.config.replace(newConfig)) ;
115
+ trace( " Tried to call notification without initializing " ) ;
116
+ return ;
117
117
}
118
+ if (msg.method == " workspace/didChangeConfiguration" )
119
+ served.extension.processConfigChange(msg.params[" settings" ].fromJSON! Configuration);
118
120
documents.process(msg);
119
121
foreach (name; __traits (derivedMembers , served.extension))
120
122
{
@@ -173,12 +175,16 @@ int main(string[] args)
173
175
bool printVer;
174
176
string [] features;
175
177
string lang = " en" ;
178
+ bool wait;
176
179
// dfmt off
177
180
auto argInfo = args.getopt(
178
181
" r|require" , " Adds a feature set that is required. Unknown feature sets will intentionally crash on startup" , &features,
179
182
" v|version" , " Print version of program" , &printVer,
180
- " lang" , " Change the language of GUI messages" , &lang);
183
+ " lang" , " Change the language of GUI messages" , &lang,
184
+ " wait" , " Wait for a second before starting (for debugging)" , &wait);
181
185
// dfmt on
186
+ if (wait)
187
+ Thread .sleep(2. seconds);
182
188
if (argInfo.helpWanted)
183
189
{
184
190
if (printVer)
@@ -199,8 +205,6 @@ int main(string[] args)
199
205
200
206
fibersMutex = new Mutex ();
201
207
202
- served.types.workspaceRoot = fs.getcwd();
203
-
204
208
foreach (feature; features)
205
209
if (! IncludedFeatures.canFind(feature.toLower.strip))
206
210
throw new Exception (" Feature set '" ~ feature ~ " ' not in this version of serve-d" );
@@ -225,17 +229,15 @@ int main(string[] args)
225
229
{
226
230
while (rpc.hasData)
227
231
{
228
- trace(" Has Message" );
229
232
auto msg = rpc.poll;
230
- trace(" Message: " , msg);
233
+ // Log on client side instead! (vscode setting: "serve-d.trace.server": "verbose")
234
+ // trace("Message: ", msg);
231
235
if (msg.id.hasData)
232
236
pushFiber({
233
237
ResponseMessage res;
234
238
try
235
239
{
236
- trace(" Processing as request" );
237
240
res = processRequest(msg);
238
- trace(" Responding with: " , res);
239
241
}
240
242
catch (Throwable e)
241
243
{
@@ -249,7 +251,6 @@ int main(string[] args)
249
251
pushFiber({
250
252
try
251
253
{
252
- trace(" Processing as notification" );
253
254
processNotify(msg);
254
255
}
255
256
catch (Throwable e)
0 commit comments