mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LanguageServers/Cpp: Update client asynchronously about symbols
As a document is parsed, the language server updates the client asynchronously about symbol declarations it finds.
This commit is contained in:
parent
71c7597130
commit
a94b5376bc
12 changed files with 83 additions and 19 deletions
|
@ -31,9 +31,13 @@
|
|||
#include <LibGUI/AutocompleteProvider.h>
|
||||
#include <LibGUI/TextPosition.h>
|
||||
|
||||
namespace LanguageServers::Cpp {
|
||||
|
||||
class ClientConnection;
|
||||
|
||||
class AutoCompleteEngine {
|
||||
public:
|
||||
AutoCompleteEngine(const FileDB& filedb);
|
||||
AutoCompleteEngine(ClientConnection&, const FileDB& filedb);
|
||||
virtual ~AutoCompleteEngine();
|
||||
|
||||
virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position) = 0;
|
||||
|
@ -44,9 +48,15 @@ public:
|
|||
|
||||
virtual Optional<GUI::AutocompleteProvider::ProjectLocation> find_declaration_of(const String&, const GUI::TextPosition&) { return {}; };
|
||||
|
||||
public:
|
||||
Function<void(ClientConnection&, String, Vector<GUI::AutocompleteProvider::Declaration>)> set_declarations_of_document_callback;
|
||||
|
||||
protected:
|
||||
const FileDB& filedb() const { return m_filedb; }
|
||||
void set_declarations_of_document(const String&, Vector<GUI::AutocompleteProvider::Declaration>&&);
|
||||
|
||||
private:
|
||||
ClientConnection& m_connection;
|
||||
const FileDB& m_filedb;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue