/* * Copyright (c) 2020, Itamar S. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "../LanguageClient.h" #include #include #include #include #define LANGUAGE_CLIENT(language_name_, socket_name) \ namespace language_name_ { \ class ServerConnection final : public HackStudio::ServerConnection { \ C_OBJECT(ServerConnection) \ public: \ static const char* language_name() { return #language_name_; } \ \ private: \ ServerConnection(const String& project_path) \ : HackStudio::ServerConnection("/tmp/portal/language/" #socket_name, project_path) \ { \ } \ }; \ } namespace LanguageClients { LANGUAGE_CLIENT(Cpp, cpp) LANGUAGE_CLIENT(Shell, shell) } #undef LANGUAGE_CLIENT