ClientConnection.h 881 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include "AutoComplete.h"
  8. #include <DevTools/HackStudio/LanguageServers/ClientConnection.h>
  9. namespace LanguageServers::Shell {
  10. class ClientConnection final : public LanguageServers::ClientConnection {
  11. C_OBJECT(ClientConnection);
  12. ClientConnection(NonnullRefPtr<Core::LocalSocket> socket, int client_id)
  13. : LanguageServers::ClientConnection(move(socket), client_id)
  14. {
  15. m_autocomplete_engine = make<AutoComplete>(m_filedb);
  16. m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
  17. async_declarations_in_document(filename, move(declarations));
  18. };
  19. }
  20. virtual ~ClientConnection() override = default;
  21. };
  22. }