@@ -119,7 +119,7 @@ LanguageServer::LanguageServer(Transport& _transport):
119119 {" exit" , [this ](auto , auto ) { m_state = (m_state == State::ShutdownRequested ? State::ExitRequested : State::ExitWithoutShutdown); }},
120120 {" initialize" , bind (&LanguageServer::handleInitialize, this , _1, _2)},
121121 {" initialized" , [](auto , auto ) {}},
122- {" $/setTrace" , bind (&LanguageServer::setTrace, this , _2) },
122+ {" $/setTrace" , [ this ]( auto , Json::Value const & args) { setTrace (args[ " value " ]); } },
123123 {" shutdown" , [this ](auto , auto ) { m_state = State::ShutdownRequested; }},
124124 {" textDocument/definition" , GotoDefinition (*this ) },
125125 {" textDocument/didOpen" , bind (&LanguageServer::handleTextDocumentDidOpen, this , _2)},
@@ -325,6 +325,9 @@ void LanguageServer::handleInitialize(MessageID _id, Json::Value const& _args)
325325 else if (Json::Value rootPath = _args[" rootPath" ])
326326 rootPath = rootPath.asString ();
327327
328+ if (_args[" trace" ])
329+ setTrace (_args[" trace" ]);
330+
328331 m_fileRepository = FileRepository (rootPath, {});
329332 if (_args[" initializationOptions" ].isObject ())
330333 changeConfiguration (_args[" initializationOptions" ]);
@@ -341,7 +344,6 @@ void LanguageServer::handleInitialize(MessageID _id, Json::Value const& _args)
341344 replyArgs[" capabilities" ][" semanticTokensProvider" ][" full" ] = true ; // XOR requests.full.delta = true
342345 replyArgs[" capabilities" ][" renameProvider" ] = true ;
343346
344-
345347 m_client.reply (_id, move (replyArgs));
346348}
347349
@@ -372,11 +374,11 @@ void LanguageServer::handleWorkspaceDidChangeConfiguration(Json::Value const& _a
372374
373375void LanguageServer::setTrace (Json::Value const & _args)
374376{
375- if (!_args[ " value " ] .isString ())
377+ if (!_args.isString ())
376378 // Simply ignore invalid parameter.
377379 return ;
378380
379- string const stringValue = _args[ " value " ] .asString ();
381+ string const stringValue = _args.asString ();
380382 if (stringValue == " off" )
381383 m_client.setTrace (TraceValue::Off);
382384 else if (stringValue == " messages" )
0 commit comments