diff --git a/Userland/DevTools/Playground/CMakeLists.txt b/Userland/DevTools/Playground/CMakeLists.txt index 6fa9f90b699..8b8a2604ebb 100644 --- a/Userland/DevTools/Playground/CMakeLists.txt +++ b/Userland/DevTools/Playground/CMakeLists.txt @@ -6,7 +6,6 @@ serenity_component( set(SOURCES main.cpp - GMLAutocompleteProvider.cpp ) serenity_app(Playground ICON app-playground) diff --git a/Userland/DevTools/Playground/main.cpp b/Userland/DevTools/Playground/main.cpp index 7e0bd30e3d5..e139e3c6137 100644 --- a/Userland/DevTools/Playground/main.cpp +++ b/Userland/DevTools/Playground/main.cpp @@ -4,13 +4,13 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include "GMLAutocompleteProvider.h" #include #include #include #include #include #include +#include #include #include #include @@ -102,7 +102,7 @@ int main(int argc, char** argv) auto& preview = splitter.add(); editor.set_syntax_highlighter(make()); - editor.set_autocomplete_provider(make()); + editor.set_autocomplete_provider(make()); editor.set_should_autocomplete_automatically(true); editor.set_automatic_indentation_enabled(true); diff --git a/Userland/Libraries/LibGUI/CMakeLists.txt b/Userland/Libraries/LibGUI/CMakeLists.txt index 7f6cf35750f..62a0a424577 100644 --- a/Userland/Libraries/LibGUI/CMakeLists.txt +++ b/Userland/Libraries/LibGUI/CMakeLists.txt @@ -39,6 +39,7 @@ set(SOURCES FontPicker.cpp FontPickerDialogGML.h Frame.cpp + GMLAutocompleteProvider.cpp GMLFormatter.cpp GMLLexer.cpp GMLParser.cpp diff --git a/Userland/DevTools/Playground/GMLAutocompleteProvider.cpp b/Userland/Libraries/LibGUI/GMLAutocompleteProvider.cpp similarity index 99% rename from Userland/DevTools/Playground/GMLAutocompleteProvider.cpp rename to Userland/Libraries/LibGUI/GMLAutocompleteProvider.cpp index 150f619b929..2b74356de97 100644 --- a/Userland/DevTools/Playground/GMLAutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/GMLAutocompleteProvider.cpp @@ -5,8 +5,10 @@ */ #include "GMLAutocompleteProvider.h" +#include "GMLLexer.h" #include -#include + +namespace GUI { void GMLAutocompleteProvider::provide_completions(Function)> callback) { @@ -207,3 +209,5 @@ void GMLAutocompleteProvider::provide_completions(Function)> callback(move(entries)); } + +} diff --git a/Userland/DevTools/Playground/GMLAutocompleteProvider.h b/Userland/Libraries/LibGUI/GMLAutocompleteProvider.h similarity index 91% rename from Userland/DevTools/Playground/GMLAutocompleteProvider.h rename to Userland/Libraries/LibGUI/GMLAutocompleteProvider.h index f6aaf21ed05..b08e30db518 100644 --- a/Userland/DevTools/Playground/GMLAutocompleteProvider.h +++ b/Userland/Libraries/LibGUI/GMLAutocompleteProvider.h @@ -6,7 +6,9 @@ #pragma once -#include +#include "AutocompleteProvider.h" + +namespace GUI { class GMLAutocompleteProvider final : public virtual GUI::AutocompleteProvider { public: @@ -21,3 +23,5 @@ private: virtual void provide_completions(Function)> callback) override; }; + +}