mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 04:15:23 +03:00
LibGUI+Playground: Move GMLAutocompleteProvider to LibGUI
This commit is contained in:
parent
4c17f389db
commit
2b5566d7cc
Notes:
sideshowbarker
2024-07-18 07:56:05 +09:00
Author: https://github.com/caoimhebyrne 🔰 Commit: https://github.com/SerenityOS/serenity/commit/2b5566d7cc8 Pull-request: https://github.com/SerenityOS/serenity/pull/9068
@ -6,7 +6,6 @@ serenity_component(
|
||||
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
GMLAutocompleteProvider.cpp
|
||||
)
|
||||
|
||||
serenity_app(Playground ICON app-playground)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -39,6 +39,7 @@ set(SOURCES
|
||||
FontPicker.cpp
|
||||
FontPickerDialogGML.h
|
||||
Frame.cpp
|
||||
GMLAutocompleteProvider.cpp
|
||||
GMLFormatter.cpp
|
||||
GMLLexer.cpp
|
||||
GMLParser.cpp
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user