LibGUI+Playground: Move GMLAutocompleteProvider to LibGUI

This commit is contained in:
Conor Byrne 2021-07-28 14:50:24 +01:00 committed by Andreas Kling
parent 4c17f389db
commit 2b5566d7cc
Notes: sideshowbarker 2024-07-18 07:56:05 +09:00
5 changed files with 13 additions and 5 deletions

View File

@ -6,7 +6,6 @@ serenity_component(
set(SOURCES
main.cpp
GMLAutocompleteProvider.cpp
)
serenity_app(Playground ICON app-playground)

View File

@ -4,13 +4,13 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "GMLAutocompleteProvider.h"
#include <AK/URL.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/File.h>
#include <LibDesktop/Launcher.h>
#include <LibGUI/Application.h>
#include <LibGUI/FilePicker.h>
#include <LibGUI/GMLAutocompleteProvider.h>
#include <LibGUI/GMLFormatter.h>
#include <LibGUI/GMLLexer.h>
#include <LibGUI/GMLSyntaxHighlighter.h>
@ -102,7 +102,7 @@ int main(int argc, char** argv)
auto& preview = splitter.add<GUI::Frame>();
editor.set_syntax_highlighter(make<GUI::GMLSyntaxHighlighter>());
editor.set_autocomplete_provider(make<GMLAutocompleteProvider>());
editor.set_autocomplete_provider(make<GUI::GMLAutocompleteProvider>());
editor.set_should_autocomplete_automatically(true);
editor.set_automatic_indentation_enabled(true);

View File

@ -39,6 +39,7 @@ set(SOURCES
FontPicker.cpp
FontPickerDialogGML.h
Frame.cpp
GMLAutocompleteProvider.cpp
GMLFormatter.cpp
GMLLexer.cpp
GMLParser.cpp

View File

@ -5,8 +5,10 @@
*/
#include "GMLAutocompleteProvider.h"
#include "GMLLexer.h"
#include <AK/QuickSort.h>
#include <LibGUI/GMLLexer.h>
namespace GUI {
void GMLAutocompleteProvider::provide_completions(Function<void(Vector<Entry>)> callback)
{
@ -207,3 +209,5 @@ void GMLAutocompleteProvider::provide_completions(Function<void(Vector<Entry>)>
callback(move(entries));
}
}

View File

@ -6,7 +6,9 @@
#pragma once
#include <LibGUI/AutocompleteProvider.h>
#include "AutocompleteProvider.h"
namespace GUI {
class GMLAutocompleteProvider final : public virtual GUI::AutocompleteProvider {
public:
@ -21,3 +23,5 @@ private:
virtual void provide_completions(Function<void(Vector<Entry>)> callback) override;
};
}