@@ -155,6 +155,7 @@ nlohmann::json vscode::ServerCapabilities::Serialize()
155155 object[" documentOnTypeFormattingProvider" ] = documentOnTypeFormattingProvider.Serialize ();
156156 object[" codeActionProvider" ] = codeActionProvider;
157157 object[" executeCommandProvider" ] = executeCommandProvider.Serialize ();
158+ object[" completionProvider" ] = completionProvider.Serialize ();
158159
159160 return object;
160161}
@@ -331,6 +332,15 @@ nlohmann::json vscode::ExecuteCommandOptions::Serialize()
331332 return object;
332333}
333334
335+ nlohmann::json vscode::CompletionOptions::Serialize ()
336+ {
337+ auto object = nlohmann::json::object ();
338+ object[" triggerCharacters" ] = SerializeArray (triggerCharacters);
339+ object[" resolveProvider" ] = resolveProvider;
340+
341+ return object;
342+ }
343+
334344void vscode::TextDocumentPositionParams::Deserialize (nlohmann::json json)
335345{
336346 textDocument.Deserialize (json[" textDocument" ]);
@@ -365,7 +375,7 @@ nlohmann::json vscode::Command::Serialize()
365375
366376 auto array = nlohmann::json::array ();
367377
368- for (auto & arg: arguments)
378+ for (auto & arg : arguments)
369379 {
370380 array.push_back (arg);
371381 }
@@ -401,10 +411,12 @@ void vscode::ExecuteCommandParams::Deserialize(nlohmann::json json)
401411{
402412 command = json[" command" ];
403413 auto args = json[" arguments" ];
404- if (args.is_array ())
414+ if (args.is_array ())
405415 {
406- for (auto arg : args) {
407- if (!arg.is_null ()) {
416+ for (auto arg : args)
417+ {
418+ if (!arg.is_null ())
419+ {
408420 arguments.push_back (arg);
409421 }
410422 }
@@ -414,7 +426,7 @@ void vscode::ExecuteCommandParams::Deserialize(nlohmann::json json)
414426nlohmann::json vscode::OptionalVersionedTextDocumentIdentifier::Serialize ()
415427{
416428 auto object = TextDocument::Serialize ();
417- if (version.has_value ())
429+ if (version.has_value ())
418430 {
419431 object[" version" ] = version.value ();
420432 }
@@ -443,7 +455,8 @@ nlohmann::json vscode::WorkspaceEdit::Serialize()
443455
444456 auto changesObject = nlohmann::json::object ();
445457
446- for (auto it : changes) {
458+ for (auto it : changes)
459+ {
447460 changesObject[it.first ] = SerializeArray (it.second );
448461 }
449462 object[" changes" ] = changesObject;
@@ -455,7 +468,7 @@ nlohmann::json vscode::ApplyWorkspaceEditParams::Serialize()
455468{
456469 auto object = nlohmann::json::object ();
457470
458- if (label.has_value ())
471+ if (label.has_value ())
459472 {
460473 object[" label" ] = label.value ();
461474 }
@@ -468,3 +481,26 @@ nlohmann::json vscode::ApplyWorkspaceEditParams::Serialize()
468481
469482 return object;
470483}
484+
485+ void vscode::FileEvent::Deserialize (nlohmann::json json)
486+ {
487+ uri = json[" uri" ];
488+ type = static_cast <FileChangeType>(static_cast <uint32_t >(json[" type" ]));
489+ }
490+
491+ void vscode::DidChangeWatchedFilesParams::Deserialize (nlohmann::json json)
492+ {
493+ if (json[" changes" ].is_array ())
494+ {
495+ for (auto & v : json[" changes" ])
496+ {
497+ changes.emplace_back ().Deserialize (v);
498+ }
499+ }
500+ }
501+
502+ void vscode::CompletionParams::Deserialize (nlohmann::json json)
503+ {
504+ textDocument.Deserialize (json[" textDocument" ]);
505+ position.Deserialize (json[" position" ]);
506+ }
0 commit comments