mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 08:32:43 +00:00 
			
		
		
		
	Everywhere: Run clang-format
This commit is contained in:
		
							parent
							
								
									0376c127f6
								
							
						
					
					
						commit
						086969277e
					
				
					 1665 changed files with 8479 additions and 8479 deletions
				
			
		|  | @ -20,12 +20,12 @@ | |||
| 
 | ||||
| namespace LanguageServers::Cpp { | ||||
| 
 | ||||
| CppComprehensionEngine::CppComprehensionEngine(const FileDB& filedb) | ||||
| CppComprehensionEngine::CppComprehensionEngine(FileDB const& filedb) | ||||
|     : CodeComprehensionEngine(filedb, true) | ||||
| { | ||||
| } | ||||
| 
 | ||||
| const CppComprehensionEngine::DocumentData* CppComprehensionEngine::get_or_create_document_data(const String& file) | ||||
| CppComprehensionEngine::DocumentData const* CppComprehensionEngine::get_or_create_document_data(String const& file) | ||||
| { | ||||
|     auto absolute_path = filedb().to_absolute_path(file); | ||||
|     if (!m_documents.contains(absolute_path)) { | ||||
|  | @ -34,7 +34,7 @@ const CppComprehensionEngine::DocumentData* CppComprehensionEngine::get_or_creat | |||
|     return get_document_data(absolute_path); | ||||
| } | ||||
| 
 | ||||
| const CppComprehensionEngine::DocumentData* CppComprehensionEngine::get_document_data(const String& file) const | ||||
| CppComprehensionEngine::DocumentData const* CppComprehensionEngine::get_document_data(String const& file) const | ||||
| { | ||||
|     auto absolute_path = filedb().to_absolute_path(file); | ||||
|     auto document_data = m_documents.get(absolute_path); | ||||
|  | @ -43,7 +43,7 @@ const CppComprehensionEngine::DocumentData* CppComprehensionEngine::get_document | |||
|     return document_data.value(); | ||||
| } | ||||
| 
 | ||||
| OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_document_data_for(const String& file) | ||||
| OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_document_data_for(String const& file) | ||||
| { | ||||
|     if (m_unfinished_documents.contains(file)) { | ||||
|         return {}; | ||||
|  | @ -56,22 +56,22 @@ OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_docu | |||
|     return create_document_data(document->text(), file); | ||||
| } | ||||
| 
 | ||||
| void CppComprehensionEngine::set_document_data(const String& file, OwnPtr<DocumentData>&& data) | ||||
| void CppComprehensionEngine::set_document_data(String const& file, OwnPtr<DocumentData>&& data) | ||||
| { | ||||
|     m_documents.set(filedb().to_absolute_path(file), move(data)); | ||||
| } | ||||
| 
 | ||||
| Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position) | ||||
| Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::get_suggestions(String const& file, const GUI::TextPosition& autocomplete_position) | ||||
| { | ||||
|     Cpp::Position position { autocomplete_position.line(), autocomplete_position.column() > 0 ? autocomplete_position.column() - 1 : 0 }; | ||||
| 
 | ||||
|     dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "CppComprehensionEngine position {}:{}", position.line, position.column); | ||||
| 
 | ||||
|     const auto* document_ptr = get_or_create_document_data(file); | ||||
|     auto const* document_ptr = get_or_create_document_data(file); | ||||
|     if (!document_ptr) | ||||
|         return {}; | ||||
| 
 | ||||
|     const auto& document = *document_ptr; | ||||
|     auto const& document = *document_ptr; | ||||
|     auto containing_token = document.parser().token_at(position); | ||||
| 
 | ||||
|     if (containing_token.has_value() && containing_token->type() == Token::Type::IncludePath) { | ||||
|  | @ -102,7 +102,7 @@ Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::get_suggestions | |||
|     return {}; | ||||
| } | ||||
| 
 | ||||
| Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_name(const DocumentData& document, const ASTNode& node, Optional<Token> containing_token) const | ||||
| Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_name(DocumentData const& document, ASTNode const& node, Optional<Token> containing_token) const | ||||
| { | ||||
|     auto partial_text = String::empty(); | ||||
|     if (containing_token.has_value() && containing_token.value().type() != Token::Type::ColonColon) { | ||||
|  | @ -111,7 +111,7 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a | |||
|     return autocomplete_name(document, node, partial_text); | ||||
| } | ||||
| 
 | ||||
| Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_property(const DocumentData& document, const ASTNode& node, Optional<Token> containing_token) const | ||||
| Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_property(DocumentData const& document, ASTNode const& node, Optional<Token> containing_token) const | ||||
| { | ||||
|     if (!containing_token.has_value()) | ||||
|         return {}; | ||||
|  | @ -119,7 +119,7 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a | |||
|     if (!node.parent()->is_member_expression()) | ||||
|         return {}; | ||||
| 
 | ||||
|     const auto& parent = static_cast<const MemberExpression&>(*node.parent()); | ||||
|     auto const& parent = static_cast<MemberExpression const&>(*node.parent()); | ||||
| 
 | ||||
|     auto partial_text = String::empty(); | ||||
|     if (containing_token.value().type() != Token::Type::Dot) { | ||||
|  | @ -131,12 +131,12 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a | |||
|     return autocomplete_property(document, parent, partial_text); | ||||
| } | ||||
| 
 | ||||
| Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_name(const DocumentData& document, const ASTNode& node, const String& partial_text) const | ||||
| Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_name(DocumentData const& document, ASTNode const& node, String const& partial_text) const | ||||
| { | ||||
|     auto reference_scope = scope_of_reference_to_symbol(node); | ||||
|     auto current_scope = scope_of_node(node); | ||||
| 
 | ||||
|     auto symbol_matches = [&](const Symbol& symbol) { | ||||
|     auto symbol_matches = [&](Symbol const& symbol) { | ||||
|         if (!is_symbol_available(symbol, current_scope, reference_scope)) { | ||||
|             return false; | ||||
|         } | ||||
|  | @ -156,7 +156,7 @@ Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_na | |||
| 
 | ||||
|     Vector<Symbol> matches; | ||||
| 
 | ||||
|     for_each_available_symbol(document, [&](const Symbol& symbol) { | ||||
|     for_each_available_symbol(document, [&](Symbol const& symbol) { | ||||
|         if (symbol_matches(symbol)) { | ||||
|             matches.append(symbol); | ||||
|         } | ||||
|  | @ -179,17 +179,17 @@ Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_na | |||
|     return suggestions; | ||||
| } | ||||
| 
 | ||||
| Vector<StringView> CppComprehensionEngine::scope_of_reference_to_symbol(const ASTNode& node) const | ||||
| Vector<StringView> CppComprehensionEngine::scope_of_reference_to_symbol(ASTNode const& node) const | ||||
| { | ||||
|     const Name* name = nullptr; | ||||
|     Name const* name = nullptr; | ||||
|     if (node.is_name()) { | ||||
|         // FIXME It looks like this code path is never taken
 | ||||
|         name = reinterpret_cast<const Name*>(&node); | ||||
|         name = reinterpret_cast<Name const*>(&node); | ||||
|     } else if (node.is_identifier()) { | ||||
|         auto* parent = node.parent(); | ||||
|         if (!(parent && parent->is_name())) | ||||
|             return {}; | ||||
|         name = reinterpret_cast<const Name*>(parent); | ||||
|         name = reinterpret_cast<Name const*>(parent); | ||||
|     } else { | ||||
|         return {}; | ||||
|     } | ||||
|  | @ -206,7 +206,7 @@ Vector<StringView> CppComprehensionEngine::scope_of_reference_to_symbol(const AS | |||
|     return scope_parts; | ||||
| } | ||||
| 
 | ||||
| Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_property(const DocumentData& document, const MemberExpression& parent, const String partial_text) const | ||||
| Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_property(DocumentData const& document, MemberExpression const& parent, const String partial_text) const | ||||
| { | ||||
|     VERIFY(parent.object()); | ||||
|     auto type = type_of(document, *parent.object()); | ||||
|  | @ -224,7 +224,7 @@ Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_pr | |||
|     return suggestions; | ||||
| } | ||||
| 
 | ||||
| bool CppComprehensionEngine::is_property(const ASTNode& node) const | ||||
| bool CppComprehensionEngine::is_property(ASTNode const& node) const | ||||
| { | ||||
|     if (!node.parent()->is_member_expression()) | ||||
|         return false; | ||||
|  | @ -233,7 +233,7 @@ bool CppComprehensionEngine::is_property(const ASTNode& node) const | |||
|     return parent.property() == &node; | ||||
| } | ||||
| 
 | ||||
| String CppComprehensionEngine::type_of_property(const DocumentData& document, const Identifier& identifier) const | ||||
| String CppComprehensionEngine::type_of_property(DocumentData const& document, Identifier const& identifier) const | ||||
| { | ||||
|     auto& parent = verify_cast<MemberExpression>(*identifier.parent()); | ||||
|     VERIFY(parent.object()); | ||||
|  | @ -241,7 +241,7 @@ String CppComprehensionEngine::type_of_property(const DocumentData& document, co | |||
|     for (auto& prop : properties) { | ||||
|         if (prop.name.name != identifier.name()) | ||||
|             continue; | ||||
|         const Type* type { nullptr }; | ||||
|         Type const* type { nullptr }; | ||||
|         if (prop.declaration->is_variable_declaration()) { | ||||
|             type = verify_cast<VariableDeclaration>(*prop.declaration).type(); | ||||
|         } | ||||
|  | @ -258,9 +258,9 @@ String CppComprehensionEngine::type_of_property(const DocumentData& document, co | |||
|     return {}; | ||||
| } | ||||
| 
 | ||||
| String CppComprehensionEngine::type_of_variable(const Identifier& identifier) const | ||||
| String CppComprehensionEngine::type_of_variable(Identifier const& identifier) const | ||||
| { | ||||
|     const ASTNode* current = &identifier; | ||||
|     ASTNode const* current = &identifier; | ||||
|     while (current) { | ||||
|         for (auto& decl : current->declarations()) { | ||||
|             if (decl.is_variable_or_parameter_declaration()) { | ||||
|  | @ -278,21 +278,21 @@ String CppComprehensionEngine::type_of_variable(const Identifier& identifier) co | |||
|     return {}; | ||||
| } | ||||
| 
 | ||||
| String CppComprehensionEngine::type_of(const DocumentData& document, const Expression& expression) const | ||||
| String CppComprehensionEngine::type_of(DocumentData const& document, Expression const& expression) const | ||||
| { | ||||
|     if (expression.is_member_expression()) { | ||||
|         auto& member_expression = verify_cast<MemberExpression>(expression); | ||||
|         VERIFY(member_expression.property()); | ||||
|         if (member_expression.property()->is_identifier()) | ||||
|             return type_of_property(document, static_cast<const Identifier&>(*member_expression.property())); | ||||
|             return type_of_property(document, static_cast<Identifier const&>(*member_expression.property())); | ||||
|         return {}; | ||||
|     } | ||||
| 
 | ||||
|     const Identifier* identifier { nullptr }; | ||||
|     Identifier const* identifier { nullptr }; | ||||
|     if (expression.is_name()) { | ||||
|         identifier = static_cast<const Name&>(expression).name(); | ||||
|         identifier = static_cast<Name const&>(expression).name(); | ||||
|     } else if (expression.is_identifier()) { | ||||
|         identifier = &static_cast<const Identifier&>(expression); | ||||
|         identifier = &static_cast<Identifier const&>(expression); | ||||
|     } else { | ||||
|         dbgln("expected identifier or name, got: {}", expression.class_name()); | ||||
|         VERIFY_NOT_REACHED(); // TODO
 | ||||
|  | @ -304,7 +304,7 @@ String CppComprehensionEngine::type_of(const DocumentData& document, const Expre | |||
|     return type_of_variable(*identifier); | ||||
| } | ||||
| 
 | ||||
| Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::properties_of_type(const DocumentData& document, const String& type) const | ||||
| Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::properties_of_type(DocumentData const& document, String const& type) const | ||||
| { | ||||
|     auto type_symbol = SymbolName::create(type); | ||||
|     auto decl = find_declaration_of(document, type_symbol); | ||||
|  | @ -331,17 +331,17 @@ Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::properties_of_typ | |||
|     return properties; | ||||
| } | ||||
| 
 | ||||
| CppComprehensionEngine::Symbol CppComprehensionEngine::Symbol::create(StringView name, const Vector<StringView>& scope, NonnullRefPtr<Declaration> declaration, IsLocal is_local) | ||||
| CppComprehensionEngine::Symbol CppComprehensionEngine::Symbol::create(StringView name, Vector<StringView> const& scope, NonnullRefPtr<Declaration> declaration, IsLocal is_local) | ||||
| { | ||||
|     return { { name, scope }, move(declaration), is_local == IsLocal::Yes }; | ||||
| } | ||||
| 
 | ||||
| Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols(const ASTNode& node) const | ||||
| Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols(ASTNode const& node) const | ||||
| { | ||||
|     return get_child_symbols(node, {}, Symbol::IsLocal::No); | ||||
| } | ||||
| 
 | ||||
| Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols(const ASTNode& node, const Vector<StringView>& scope, Symbol::IsLocal is_local) const | ||||
| Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols(ASTNode const& node, Vector<StringView> const& scope, Symbol::IsLocal is_local) const | ||||
| { | ||||
|     Vector<Symbol> symbols; | ||||
| 
 | ||||
|  | @ -391,23 +391,23 @@ String CppComprehensionEngine::document_path_from_include_path(StringView includ | |||
|     return result; | ||||
| } | ||||
| 
 | ||||
| void CppComprehensionEngine::on_edit(const String& file) | ||||
| void CppComprehensionEngine::on_edit(String const& file) | ||||
| { | ||||
|     set_document_data(file, create_document_data_for(file)); | ||||
| } | ||||
| 
 | ||||
| void CppComprehensionEngine::file_opened([[maybe_unused]] const String& file) | ||||
| void CppComprehensionEngine::file_opened([[maybe_unused]] String const& file) | ||||
| { | ||||
|     get_or_create_document_data(file); | ||||
| } | ||||
| 
 | ||||
| Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::find_declaration_of(const String& filename, const GUI::TextPosition& identifier_position) | ||||
| Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::find_declaration_of(String const& filename, const GUI::TextPosition& identifier_position) | ||||
| { | ||||
|     const auto* document_ptr = get_or_create_document_data(filename); | ||||
|     auto const* document_ptr = get_or_create_document_data(filename); | ||||
|     if (!document_ptr) | ||||
|         return {}; | ||||
| 
 | ||||
|     const auto& document = *document_ptr; | ||||
|     auto const& document = *document_ptr; | ||||
|     auto decl = find_declaration_of(document, identifier_position); | ||||
|     if (decl) { | ||||
|         return GUI::AutocompleteProvider::ProjectLocation { decl->filename(), decl->start().line, decl->start().column }; | ||||
|  | @ -416,7 +416,7 @@ Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::fin | |||
|     return find_preprocessor_definition(document, identifier_position); | ||||
| } | ||||
| 
 | ||||
| RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentData& document, const GUI::TextPosition& identifier_position) | ||||
| RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(DocumentData const& document, const GUI::TextPosition& identifier_position) | ||||
| { | ||||
|     auto node = document.parser().node_at(Cpp::Position { identifier_position.line(), identifier_position.column() }); | ||||
|     if (!node) { | ||||
|  | @ -426,7 +426,7 @@ RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentDa | |||
|     return find_declaration_of(document, *node); | ||||
| } | ||||
| 
 | ||||
| Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::find_preprocessor_definition(const DocumentData& document, const GUI::TextPosition& text_position) | ||||
| Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::find_preprocessor_definition(DocumentData const& document, const GUI::TextPosition& text_position) | ||||
| { | ||||
|     Position cpp_position { text_position.line(), text_position.column() }; | ||||
|     auto substitution = find_preprocessor_substitution(document, cpp_position); | ||||
|  | @ -459,11 +459,11 @@ struct TargetDeclaration { | |||
|     String name; | ||||
| }; | ||||
| 
 | ||||
| static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node, String name); | ||||
| static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node) | ||||
| static Optional<TargetDeclaration> get_target_declaration(ASTNode const& node, String name); | ||||
| static Optional<TargetDeclaration> get_target_declaration(ASTNode const& node) | ||||
| { | ||||
|     if (node.is_identifier()) { | ||||
|         return get_target_declaration(node, static_cast<const Identifier&>(node).name()); | ||||
|         return get_target_declaration(node, static_cast<Identifier const&>(node).name()); | ||||
|     } | ||||
| 
 | ||||
|     if (node.is_declaration()) { | ||||
|  | @ -478,7 +478,7 @@ static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node) | |||
|     return {}; | ||||
| } | ||||
| 
 | ||||
| static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node, String name) | ||||
| static Optional<TargetDeclaration> get_target_declaration(ASTNode const& node, String name) | ||||
| { | ||||
|     if (node.parent() && node.parent()->is_name()) { | ||||
|         auto& name_node = *verify_cast<Name>(node.parent()); | ||||
|  | @ -509,7 +509,7 @@ static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node, S | |||
| 
 | ||||
|     return TargetDeclaration { TargetDeclaration::Type::Variable, name }; | ||||
| } | ||||
| RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentData& document_data, const ASTNode& node) const | ||||
| RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(DocumentData const& document_data, ASTNode const& node) const | ||||
| { | ||||
|     dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "find_declaration_of: {} ({})", document_data.parser().text_of_node(node), node.class_name()); | ||||
| 
 | ||||
|  | @ -520,7 +520,7 @@ RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentDa | |||
|     auto reference_scope = scope_of_reference_to_symbol(node); | ||||
|     auto current_scope = scope_of_node(node); | ||||
| 
 | ||||
|     auto symbol_matches = [&](const Symbol& symbol) { | ||||
|     auto symbol_matches = [&](Symbol const& symbol) { | ||||
|         bool match_function = target_decl.value().type == TargetDeclaration::Function && symbol.declaration->is_function(); | ||||
|         bool match_variable = target_decl.value().type == TargetDeclaration::Variable && symbol.declaration->is_variable_declaration(); | ||||
|         bool match_type = target_decl.value().type == TargetDeclaration::Type && (symbol.declaration->is_struct_or_class() || symbol.declaration->is_enum()); | ||||
|  | @ -558,7 +558,7 @@ RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentDa | |||
| 
 | ||||
|     Optional<Symbol> match; | ||||
| 
 | ||||
|     for_each_available_symbol(document_data, [&](const Symbol& symbol) { | ||||
|     for_each_available_symbol(document_data, [&](Symbol const& symbol) { | ||||
|         if (symbol_matches(symbol)) { | ||||
|             match = symbol; | ||||
|             return IterationDecision::Break; | ||||
|  | @ -595,7 +595,7 @@ void CppComprehensionEngine::update_todo_entries(DocumentData& document) | |||
|     set_todo_entries_of_document(document.filename(), document.parser().get_todo_entries()); | ||||
| } | ||||
| 
 | ||||
| GUI::AutocompleteProvider::DeclarationType CppComprehensionEngine::type_of_declaration(const Declaration& decl) | ||||
| GUI::AutocompleteProvider::DeclarationType CppComprehensionEngine::type_of_declaration(Declaration const& decl) | ||||
| { | ||||
|     if (decl.is_struct()) | ||||
|         return GUI::AutocompleteProvider::DeclarationType::Struct; | ||||
|  | @ -612,7 +612,7 @@ GUI::AutocompleteProvider::DeclarationType CppComprehensionEngine::type_of_decla | |||
|     return GUI::AutocompleteProvider::DeclarationType::Variable; | ||||
| } | ||||
| 
 | ||||
| OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_document_data(String&& text, const String& filename) | ||||
| OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_document_data(String&& text, String const& filename) | ||||
| { | ||||
|     auto document_data = make<DocumentData>(); | ||||
|     document_data->m_filename = filename; | ||||
|  | @ -657,7 +657,7 @@ OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_docu | |||
|     return document_data; | ||||
| } | ||||
| 
 | ||||
| Vector<StringView> CppComprehensionEngine::scope_of_node(const ASTNode& node) const | ||||
| Vector<StringView> CppComprehensionEngine::scope_of_node(ASTNode const& node) const | ||||
| { | ||||
| 
 | ||||
|     auto parent = node.parent(); | ||||
|  | @ -683,7 +683,7 @@ Vector<StringView> CppComprehensionEngine::scope_of_node(const ASTNode& node) co | |||
|     return parent_scope; | ||||
| } | ||||
| 
 | ||||
| Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_include(const DocumentData&, Token include_path_token, Cpp::Position const& cursor_position) const | ||||
| Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_include(DocumentData const&, Token include_path_token, Cpp::Position const& cursor_position) const | ||||
| { | ||||
|     VERIFY(include_path_token.type() == Token::Type::IncludePath); | ||||
|     auto partial_include = include_path_token.text().trim_whitespace(); | ||||
|  | @ -751,10 +751,10 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a | |||
|     return options; | ||||
| } | ||||
| 
 | ||||
| RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const CppComprehensionEngine::DocumentData& document, const CppComprehensionEngine::SymbolName& target_symbol_name) const | ||||
| RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(CppComprehensionEngine::DocumentData const& document, CppComprehensionEngine::SymbolName const& target_symbol_name) const | ||||
| { | ||||
|     RefPtr<Declaration> target_declaration; | ||||
|     for_each_available_symbol(document, [&](const Symbol& symbol) { | ||||
|     for_each_available_symbol(document, [&](Symbol const& symbol) { | ||||
|         if (symbol.name == target_symbol_name) { | ||||
|             target_declaration = symbol.declaration; | ||||
|             return IterationDecision::Break; | ||||
|  | @ -797,7 +797,7 @@ String CppComprehensionEngine::SymbolName::to_string() const | |||
|     return String::formatted("{}::{}", scope_as_string(), name); | ||||
| } | ||||
| 
 | ||||
| bool CppComprehensionEngine::is_symbol_available(const Symbol& symbol, const Vector<StringView>& current_scope, const Vector<StringView>& reference_scope) | ||||
| bool CppComprehensionEngine::is_symbol_available(Symbol const& symbol, Vector<StringView> const& current_scope, Vector<StringView> const& reference_scope) | ||||
| { | ||||
| 
 | ||||
|     if (!reference_scope.is_empty()) { | ||||
|  | @ -818,13 +818,13 @@ bool CppComprehensionEngine::is_symbol_available(const Symbol& symbol, const Vec | |||
|     return true; | ||||
| } | ||||
| 
 | ||||
| Optional<CodeComprehensionEngine::FunctionParamsHint> CppComprehensionEngine::get_function_params_hint(const String& filename, const GUI::TextPosition& identifier_position) | ||||
| Optional<CodeComprehensionEngine::FunctionParamsHint> CppComprehensionEngine::get_function_params_hint(String const& filename, const GUI::TextPosition& identifier_position) | ||||
| { | ||||
|     const auto* document_ptr = get_or_create_document_data(filename); | ||||
|     auto const* document_ptr = get_or_create_document_data(filename); | ||||
|     if (!document_ptr) | ||||
|         return {}; | ||||
| 
 | ||||
|     const auto& document = *document_ptr; | ||||
|     auto const& document = *document_ptr; | ||||
|     Cpp::Position cpp_position { identifier_position.line(), identifier_position.column() }; | ||||
|     auto node = document.parser().node_at(cpp_position); | ||||
|     if (!node) { | ||||
|  | @ -883,7 +883,7 @@ Optional<CppComprehensionEngine::FunctionParamsHint> CppComprehensionEngine::get | |||
|     FunctionCall& call_node, | ||||
|     size_t argument_index) | ||||
| { | ||||
|     const Identifier* callee = nullptr; | ||||
|     Identifier const* callee = nullptr; | ||||
|     VERIFY(call_node.callee()); | ||||
|     if (call_node.callee()->is_identifier()) { | ||||
|         callee = verify_cast<Identifier>(call_node.callee()); | ||||
|  | @ -929,15 +929,15 @@ Optional<CppComprehensionEngine::FunctionParamsHint> CppComprehensionEngine::get | |||
|     return hint; | ||||
| } | ||||
| 
 | ||||
| Vector<GUI::AutocompleteProvider::TokenInfo> CppComprehensionEngine::get_tokens_info(const String& filename) | ||||
| Vector<GUI::AutocompleteProvider::TokenInfo> CppComprehensionEngine::get_tokens_info(String const& filename) | ||||
| { | ||||
|     dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "CppComprehensionEngine::get_tokens_info: {}", filename); | ||||
| 
 | ||||
|     const auto* document_ptr = get_or_create_document_data(filename); | ||||
|     auto const* document_ptr = get_or_create_document_data(filename); | ||||
|     if (!document_ptr) | ||||
|         return {}; | ||||
| 
 | ||||
|     const auto& document = *document_ptr; | ||||
|     auto const& document = *document_ptr; | ||||
| 
 | ||||
|     Vector<GUI::AutocompleteProvider::TokenInfo> tokens_info; | ||||
|     size_t i = 0; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Idan Horowitz
						Idan Horowitz