mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 04:37:40 +00:00
LibGUI+Playground: Move GMLAutocompleteProvider to LibGUI
This commit is contained in:
parent
4c17f389db
commit
2b5566d7cc
5 changed files with 13 additions and 5 deletions
|
@ -6,7 +6,6 @@ serenity_component(
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
GMLAutocompleteProvider.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_app(Playground ICON app-playground)
|
serenity_app(Playground ICON app-playground)
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GMLAutocompleteProvider.h"
|
|
||||||
#include <AK/URL.h>
|
#include <AK/URL.h>
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/File.h>
|
||||||
#include <LibDesktop/Launcher.h>
|
#include <LibDesktop/Launcher.h>
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/FilePicker.h>
|
#include <LibGUI/FilePicker.h>
|
||||||
|
#include <LibGUI/GMLAutocompleteProvider.h>
|
||||||
#include <LibGUI/GMLFormatter.h>
|
#include <LibGUI/GMLFormatter.h>
|
||||||
#include <LibGUI/GMLLexer.h>
|
#include <LibGUI/GMLLexer.h>
|
||||||
#include <LibGUI/GMLSyntaxHighlighter.h>
|
#include <LibGUI/GMLSyntaxHighlighter.h>
|
||||||
|
@ -102,7 +102,7 @@ int main(int argc, char** argv)
|
||||||
auto& preview = splitter.add<GUI::Frame>();
|
auto& preview = splitter.add<GUI::Frame>();
|
||||||
|
|
||||||
editor.set_syntax_highlighter(make<GUI::GMLSyntaxHighlighter>());
|
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_should_autocomplete_automatically(true);
|
||||||
editor.set_automatic_indentation_enabled(true);
|
editor.set_automatic_indentation_enabled(true);
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ set(SOURCES
|
||||||
FontPicker.cpp
|
FontPicker.cpp
|
||||||
FontPickerDialogGML.h
|
FontPickerDialogGML.h
|
||||||
Frame.cpp
|
Frame.cpp
|
||||||
|
GMLAutocompleteProvider.cpp
|
||||||
GMLFormatter.cpp
|
GMLFormatter.cpp
|
||||||
GMLLexer.cpp
|
GMLLexer.cpp
|
||||||
GMLParser.cpp
|
GMLParser.cpp
|
||||||
|
|
|
@ -5,8 +5,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GMLAutocompleteProvider.h"
|
#include "GMLAutocompleteProvider.h"
|
||||||
|
#include "GMLLexer.h"
|
||||||
#include <AK/QuickSort.h>
|
#include <AK/QuickSort.h>
|
||||||
#include <LibGUI/GMLLexer.h>
|
|
||||||
|
namespace GUI {
|
||||||
|
|
||||||
void GMLAutocompleteProvider::provide_completions(Function<void(Vector<Entry>)> callback)
|
void GMLAutocompleteProvider::provide_completions(Function<void(Vector<Entry>)> callback)
|
||||||
{
|
{
|
||||||
|
@ -207,3 +209,5 @@ void GMLAutocompleteProvider::provide_completions(Function<void(Vector<Entry>)>
|
||||||
|
|
||||||
callback(move(entries));
|
callback(move(entries));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,7 +6,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <LibGUI/AutocompleteProvider.h>
|
#include "AutocompleteProvider.h"
|
||||||
|
|
||||||
|
namespace GUI {
|
||||||
|
|
||||||
class GMLAutocompleteProvider final : public virtual GUI::AutocompleteProvider {
|
class GMLAutocompleteProvider final : public virtual GUI::AutocompleteProvider {
|
||||||
public:
|
public:
|
||||||
|
@ -21,3 +23,5 @@ private:
|
||||||
|
|
||||||
virtual void provide_completions(Function<void(Vector<Entry>)> callback) override;
|
virtual void provide_completions(Function<void(Vector<Entry>)> callback) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue