mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Using iterator pattern instead of List::Element *.
Co-authored-by: Adam Scott <ascott.ca@gmail.com>
This commit is contained in:
@@ -1508,8 +1508,8 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context
|
||||
List<StringName> utility_func_names;
|
||||
Variant::get_utility_function_list(&utility_func_names);
|
||||
|
||||
for (List<StringName>::Element *E = utility_func_names.front(); E; E = E->next()) {
|
||||
ScriptLanguage::CodeCompletionOption option(E->get(), ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
|
||||
for (const StringName &util_func_name : utility_func_names) {
|
||||
ScriptLanguage::CodeCompletionOption option(util_func_name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
|
||||
option.insert_text += "(";
|
||||
option.display += U"(\u2026)"; // As all utility functions contain an argument or more, this is hardcoded here.
|
||||
r_result.insert(option.display, option);
|
||||
|
||||
@@ -543,8 +543,8 @@ Vector<LSP::Location> GDScriptWorkspace::find_all_usages(const LSP::DocumentSymb
|
||||
list_script_files("res://", paths);
|
||||
|
||||
Vector<LSP::Location> usages;
|
||||
for (List<String>::Element *PE = paths.front(); PE; PE = PE->next()) {
|
||||
usages.append_array(find_usages_in_file(p_symbol, PE->get()));
|
||||
for (const String &path : paths) {
|
||||
usages.append_array(find_usages_in_file(p_symbol, path));
|
||||
}
|
||||
return usages;
|
||||
}
|
||||
|
||||
@@ -1873,7 +1873,7 @@ struct GodotNativeClassInfo {
|
||||
const DocData::ClassDoc *class_doc = nullptr;
|
||||
const ClassDB::ClassInfo *class_info = nullptr;
|
||||
|
||||
Dictionary to_json() {
|
||||
Dictionary to_json() const {
|
||||
Dictionary dict;
|
||||
dict["name"] = name;
|
||||
dict["inherits"] = class_doc->inherits;
|
||||
@@ -1888,11 +1888,11 @@ struct GodotCapabilities {
|
||||
*/
|
||||
List<GodotNativeClassInfo> native_classes;
|
||||
|
||||
Dictionary to_json() {
|
||||
Dictionary to_json() const {
|
||||
Dictionary dict;
|
||||
Array classes;
|
||||
for (List<GodotNativeClassInfo>::Element *E = native_classes.front(); E; E = E->next()) {
|
||||
classes.push_back(E->get().to_json());
|
||||
for (const GodotNativeClassInfo &native_class : native_classes) {
|
||||
classes.push_back(native_class.to_json());
|
||||
}
|
||||
dict["native_classes"] = classes;
|
||||
return dict;
|
||||
|
||||
Reference in New Issue
Block a user