Skip to content

Commit 9e2805a

Browse files
committed
修复报错
1 parent 5f556f0 commit 9e2805a

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

3rd/uriparser/src/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#define PACKAGE_VERSION "0.9.5"
4545

46-
/* #undef HAVE_WPRINTF */
46+
#define HAVE_WPRINTF
4747
/* #undef HAVE_REALLOCARRAY */
4848

4949

CodeFormatServer/src/LanguageService.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,3 +425,8 @@ std::shared_ptr<vscode::Serializable> LanguageService::OnDidChangeWatchedFiles(
425425

426426
return nullptr;
427427
}
428+
429+
std::shared_ptr<vscode::Serializable> LanguageService::OnCompletion(std::shared_ptr<vscode::CompletionParams> param)
430+
{
431+
return nullptr;
432+
}

CodeFormatServer/src/VSCode.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,3 +504,29 @@ void vscode::CompletionParams::Deserialize(nlohmann::json json)
504504
textDocument.Deserialize(json["textDocument"]);
505505
position.Deserialize(json["position"]);
506506
}
507+
508+
nlohmann::json vscode::CompletionItem::Serialize()
509+
{
510+
auto object = nlohmann::json::object();
511+
512+
object["label"] = label;
513+
object["kind"] = static_cast<int>(kind);
514+
object["detail"] = detail;
515+
object["documentation"] = documentation;
516+
object["insertText"] = insertText;
517+
if (command.has_value())
518+
{
519+
object["command"] = command->Serialize();
520+
}
521+
522+
return object;
523+
}
524+
525+
nlohmann::json vscode::CompletionList::Serialize()
526+
{
527+
auto object = nlohmann::json::object();
528+
object["isIncomplete"] = isIncomplete;
529+
object["items"] = SerializeArray(items);
530+
531+
return object;
532+
}

include/CodeFormatServer/VSCode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,9 @@ class CompletionList : public Serializable
550550
{
551551
public:
552552
bool isIncomplete;
553-
std::vector<CompletionItem> completions;
553+
std::vector<CompletionItem> items;
554554

555-
void Deserialize(nlohmann::json json) override;
555+
nlohmann::json Serialize() override;
556556
};
557557

558558
}

0 commit comments

Comments
 (0)