1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

HackStudio: Relay completions requests to the language server unfiltered

Previously, the client would decide when to ask the server for
completions, and it would only do so for identifiers that had spans
(determined via the highlighter!).
Swap this around and make the server decide if it wants to complete
something.
This commit also adds a CompletionKind (which only has one value:
Identifier), to work with other kinds of completions as well.
This commit is contained in:
AnotherTest 2020-10-03 16:30:16 +03:30 committed by Andreas Kling
parent b42c6ea281
commit 9e73b0b696
12 changed files with 125 additions and 50 deletions

View file

@ -26,12 +26,14 @@
#pragma once
#include "AutoCompleteResponse.h"
#include <AK/Forward.h>
#include <AK/LexicalPath.h>
#include <AK/Types.h>
#include <LibIPC/ServerConnection.h>
#include <DevTools/HackStudio/LanguageServers/LanguageClientEndpoint.h>
#include <DevTools/HackStudio/LanguageServers/LanguageServerEndpoint.h>
#include <LibIPC/ServerConnection.h>
namespace HackStudio {
@ -104,9 +106,9 @@ public:
virtual void remove_text(const String& path, size_t from_line, size_t from_column, size_t to_line, size_t to_column);
virtual void request_autocomplete(const String& path, size_t cursor_line, size_t cursor_column);
void provide_autocomplete_suggestions(const Vector<String>&);
void provide_autocomplete_suggestions(const Vector<AutoCompleteResponse>&);
Function<void(Vector<String>)> on_autocomplete_suggestions;
Function<void(Vector<AutoCompleteResponse>)> on_autocomplete_suggestions;
private:
ServerConnection& m_connection;