From 02038a0edee0f01f76e90c8b4fbdf208592ea262 Mon Sep 17 00:00:00 2001 From: Itamar Date: Sat, 6 Feb 2021 16:25:15 +0200 Subject: LanguageServers/Cpp: Use FileDB and AutoCompleteEngine base class --- .../HackStudio/LanguageServers/Cpp/LexerAutoComplete.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Userland/DevTools/HackStudio/LanguageServers/Cpp/LexerAutoComplete.h') diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/LexerAutoComplete.h b/Userland/DevTools/HackStudio/LanguageServers/Cpp/LexerAutoComplete.h index e482818cfc..58a836cce2 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/LexerAutoComplete.h +++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/LexerAutoComplete.h @@ -26,6 +26,7 @@ #pragma once +#include "AutoCompleteEngine.h" #include #include #include @@ -36,16 +37,16 @@ namespace LanguageServers::Cpp { using namespace ::Cpp; -class LexerAutoComplete { +class LexerAutoComplete : public AutoCompleteEngine { public: - LexerAutoComplete() = delete; + LexerAutoComplete(const FileDB& filedb); - static Vector get_suggestions(const String& code, const GUI::TextPosition& autocomplete_position); + virtual Vector get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position) override; private: - static Optional token_in_position(const Vector&, const GUI::TextPosition&); - static StringView text_of_token(const Vector& lines, const Cpp::Token&); - static Vector identifier_prefixes(const Vector& lines, const Vector&, size_t target_token_index); + Optional token_in_position(const Vector&, const GUI::TextPosition&); + StringView text_of_token(const Vector& lines, const Cpp::Token&); + Vector identifier_prefixes(const Vector& lines, const Vector&, size_t target_token_index); }; } -- cgit v1.2.3