mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
parent
64a63e0861
commit
b5e1e05ef2
1439 changed files with 1 additions and 34187 deletions
|
|
@ -85,19 +85,15 @@ void GDScriptTextDocument::notify_client_show_symbol(const lsp::DocumentSymbol *
|
|||
}
|
||||
|
||||
void GDScriptTextDocument::initialize() {
|
||||
|
||||
if (GDScriptLanguageProtocol::get_singleton()->is_smart_resolve_enabled()) {
|
||||
|
||||
const HashMap<StringName, ClassMembers> &native_members = GDScriptLanguageProtocol::get_singleton()->get_workspace()->native_members;
|
||||
|
||||
const StringName *class_ptr = native_members.next(NULL);
|
||||
while (class_ptr) {
|
||||
|
||||
const ClassMembers &members = native_members.get(*class_ptr);
|
||||
|
||||
const String *name = members.next(NULL);
|
||||
while (name) {
|
||||
|
||||
const lsp::DocumentSymbol *symbol = members.get(*name);
|
||||
lsp::CompletionItem item = symbol->make_completion_item();
|
||||
item.data = JOIN_SYMBOLS(String(*class_ptr), *name);
|
||||
|
|
@ -112,7 +108,6 @@ void GDScriptTextDocument::initialize() {
|
|||
}
|
||||
|
||||
Variant GDScriptTextDocument::nativeSymbol(const Dictionary &p_params) {
|
||||
|
||||
Variant ret;
|
||||
|
||||
lsp::NativeSymbolInspectParams params;
|
||||
|
|
@ -142,7 +137,6 @@ Array GDScriptTextDocument::documentSymbol(const Dictionary &p_params) {
|
|||
}
|
||||
|
||||
Array GDScriptTextDocument::completion(const Dictionary &p_params) {
|
||||
|
||||
Array arr;
|
||||
|
||||
lsp::CompletionParams params;
|
||||
|
|
@ -153,12 +147,10 @@ Array GDScriptTextDocument::completion(const Dictionary &p_params) {
|
|||
GDScriptLanguageProtocol::get_singleton()->get_workspace()->completion(params, &options);
|
||||
|
||||
if (!options.empty()) {
|
||||
|
||||
int i = 0;
|
||||
arr.resize(options.size());
|
||||
|
||||
for (const List<ScriptCodeCompletionOption>::Element *E = options.front(); E; E = E->next()) {
|
||||
|
||||
const ScriptCodeCompletionOption &option = E->get();
|
||||
lsp::CompletionItem item;
|
||||
item.label = option.display;
|
||||
|
|
@ -201,11 +193,9 @@ Array GDScriptTextDocument::completion(const Dictionary &p_params) {
|
|||
i++;
|
||||
}
|
||||
} else if (GDScriptLanguageProtocol::get_singleton()->is_smart_resolve_enabled()) {
|
||||
|
||||
arr = native_member_completions.duplicate();
|
||||
|
||||
for (Map<String, ExtendGDScriptParser *>::Element *E = GDScriptLanguageProtocol::get_singleton()->get_workspace()->scripts.front(); E; E = E->next()) {
|
||||
|
||||
ExtendGDScriptParser *script = E->get();
|
||||
const Array &items = script->get_member_completions();
|
||||
|
||||
|
|
@ -220,7 +210,6 @@ Array GDScriptTextDocument::completion(const Dictionary &p_params) {
|
|||
}
|
||||
|
||||
Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) {
|
||||
|
||||
lsp::CompletionItem item;
|
||||
item.load(p_params);
|
||||
|
||||
|
|
@ -230,18 +219,15 @@ Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) {
|
|||
const lsp::DocumentSymbol *symbol = NULL;
|
||||
|
||||
if (data.get_type() == Variant::DICTIONARY) {
|
||||
|
||||
params.load(p_params["data"]);
|
||||
symbol = GDScriptLanguageProtocol::get_singleton()->get_workspace()->resolve_symbol(params, item.label, item.kind == lsp::CompletionItemKind::Method || item.kind == lsp::CompletionItemKind::Function);
|
||||
|
||||
} else if (data.get_type() == Variant::STRING) {
|
||||
|
||||
String query = data;
|
||||
|
||||
Vector<String> param_symbols = query.split(SYMBOL_SEPERATOR, false);
|
||||
|
||||
if (param_symbols.size() >= 2) {
|
||||
|
||||
String class_ = param_symbols[0];
|
||||
StringName class_name = class_;
|
||||
String member_name = param_symbols[param_symbols.size() - 1];
|
||||
|
|
@ -313,13 +299,11 @@ Array GDScriptTextDocument::colorPresentation(const Dictionary &p_params) {
|
|||
}
|
||||
|
||||
Variant GDScriptTextDocument::hover(const Dictionary &p_params) {
|
||||
|
||||
lsp::TextDocumentPositionParams params;
|
||||
params.load(p_params);
|
||||
|
||||
const lsp::DocumentSymbol *symbol = GDScriptLanguageProtocol::get_singleton()->get_workspace()->resolve_symbol(params);
|
||||
if (symbol) {
|
||||
|
||||
lsp::Hover hover;
|
||||
hover.contents = symbol->render();
|
||||
hover.range.start = params.position;
|
||||
|
|
@ -327,7 +311,6 @@ Variant GDScriptTextDocument::hover(const Dictionary &p_params) {
|
|||
return hover.to_json();
|
||||
|
||||
} else if (GDScriptLanguageProtocol::get_singleton()->is_smart_resolve_enabled()) {
|
||||
|
||||
Dictionary ret;
|
||||
Array contents;
|
||||
List<const lsp::DocumentSymbol *> list;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue