summaryrefslogtreecommitdiff
path: root/DevTools/HackStudio/Editor.h
diff options
context:
space:
mode:
Diffstat (limited to 'DevTools/HackStudio/Editor.h')
-rw-r--r--DevTools/HackStudio/Editor.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/DevTools/HackStudio/Editor.h b/DevTools/HackStudio/Editor.h
index 3c5c78a667..10c83a59d0 100644
--- a/DevTools/HackStudio/Editor.h
+++ b/DevTools/HackStudio/Editor.h
@@ -26,7 +26,6 @@
#pragma once
-#include "AutoCompleteBox.h"
#include "CodeDocument.h"
#include "Debugger/BreakpointCallback.h"
#include "LanguageClient.h"
@@ -72,7 +71,6 @@ private:
virtual void paint_event(GUI::PaintEvent&) override;
virtual void mousemove_event(GUI::MouseEvent&) override;
virtual void mousedown_event(GUI::MouseEvent&) override;
- virtual void keydown_event(GUI::KeyEvent&) override;
virtual void enter_event(Core::Event&) override;
virtual void leave_event(Core::Event&) override;
@@ -87,18 +85,26 @@ private:
GUI::TextPosition position;
};
- Optional<AutoCompleteRequestData> get_autocomplete_request_data();
+ class LanguageServerAidedAutocompleteProvider final : virtual public GUI::AutocompleteProvider {
+ public:
+ LanguageServerAidedAutocompleteProvider(LanguageClient& client)
+ : m_language_client(client)
+ {
+ }
+ virtual ~LanguageServerAidedAutocompleteProvider() override { }
+
+ private:
+ virtual void provide_completions(Function<void(Vector<Entry>)> callback) override;
+ LanguageClient& m_language_client;
+ };
- void update_autocomplete(const AutoCompleteRequestData&);
- void show_autocomplete(const AutoCompleteRequestData&);
- void close_autocomplete();
+ Optional<AutoCompleteRequestData> get_autocomplete_request_data();
void flush_file_content_to_langauge_server();
explicit Editor();
RefPtr<GUI::Window> m_documentation_tooltip_window;
- OwnPtr<AutoCompleteBox> m_autocomplete_box;
RefPtr<Web::OutOfProcessWebView> m_documentation_page_view;
String m_last_parsed_token;
GUI::TextPosition m_previous_text_position { 0, 0 };