From 32de6dde4cc9bc6f07e9d158d7132f960cd174ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Fri, 4 Feb 2022 17:46:11 +0100 Subject: [PATCH] Playground: Remove the GML formatting warning As we no longer remove comments when formatting GML, this gets rid of the warning presented to the user when there are comments in the GML. --- Userland/DevTools/Playground/main.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Userland/DevTools/Playground/main.cpp b/Userland/DevTools/Playground/main.cpp index f11f211be0..bf688c9b3a 100644 --- a/Userland/DevTools/Playground/main.cpp +++ b/Userland/DevTools/Playground/main.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2020-2021, Andreas Kling * Copyright (c) 2021, Julius Heijmen + * Copyright (c) 2022, kleines Filmröllchen * * SPDX-License-Identifier: BSD-2-Clause */ @@ -214,22 +215,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto edit_menu = TRY(window->try_add_menu("&Edit")); TRY(edit_menu->try_add_action(GUI::Action::create("&Format GML", { Mod_Ctrl | Mod_Shift, Key_I }, [&](auto&) { - auto source = editor->text(); - GUI::GML::Lexer lexer(source); - for (auto& token : lexer.lex()) { - if (token.m_type == GUI::GML::Token::Type::Comment) { - auto result = GUI::MessageBox::show( - window, - "Your GML contains comments, which currently are not supported by the formatter and will be removed. Proceed?", - "Warning", - GUI::MessageBox::Type::Warning, - GUI::MessageBox::InputType::OKCancel); - if (result == GUI::MessageBox::ExecCancel) - return; - break; - } - } - auto formatted_gml = GUI::GML::format_gml(source); + auto formatted_gml = GUI::GML::format_gml(editor->text()); if (!formatted_gml.is_null()) { editor->set_text(formatted_gml); } else {