From 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 16:41:43 +0200 Subject: Style: Enforce braces around if blocks and loops Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html --- modules/gdscript/language_server/lsp.hpp | 33 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'modules/gdscript/language_server/lsp.hpp') diff --git a/modules/gdscript/language_server/lsp.hpp b/modules/gdscript/language_server/lsp.hpp index f979171b6e..44a0076107 100644 --- a/modules/gdscript/language_server/lsp.hpp +++ b/modules/gdscript/language_server/lsp.hpp @@ -280,8 +280,9 @@ struct Command { Dictionary dict; dict["title"] = title; dict["command"] = command; - if (arguments.size()) + if (arguments.size()) { dict["arguments"] = arguments; + } return dict; } }; @@ -945,20 +946,24 @@ struct CompletionItem { dict["preselect"] = preselect; dict["sortText"] = sortText; dict["filterText"] = filterText; - if (commitCharacters.size()) + if (commitCharacters.size()) { dict["commitCharacters"] = commitCharacters; + } dict["command"] = command.to_json(); } return dict; } void load(const Dictionary &p_dict) { - if (p_dict.has("label")) + if (p_dict.has("label")) { label = p_dict["label"]; - if (p_dict.has("kind")) + } + if (p_dict.has("kind")) { kind = p_dict["kind"]; - if (p_dict.has("detail")) + } + if (p_dict.has("detail")) { detail = p_dict["detail"]; + } if (p_dict.has("documentation")) { Variant doc = p_dict["documentation"]; if (doc.get_type() == Variant::STRING) { @@ -968,18 +973,24 @@ struct CompletionItem { documentation.value = v["value"]; } } - if (p_dict.has("deprecated")) + if (p_dict.has("deprecated")) { deprecated = p_dict["deprecated"]; - if (p_dict.has("preselect")) + } + if (p_dict.has("preselect")) { preselect = p_dict["preselect"]; - if (p_dict.has("sortText")) + } + if (p_dict.has("sortText")) { sortText = p_dict["sortText"]; - if (p_dict.has("filterText")) + } + if (p_dict.has("filterText")) { filterText = p_dict["filterText"]; - if (p_dict.has("insertText")) + } + if (p_dict.has("insertText")) { insertText = p_dict["insertText"]; - if (p_dict.has("data")) + } + if (p_dict.has("data")) { data = p_dict["data"]; + } } }; -- cgit v1.2.3