diff options
| author | Yong He <yonghe@outlook.com> | 2022-06-01 17:36:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-01 17:36:44 -0700 |
| commit | fa10f7dc23f8b93c0f9ef3fb5477871a20aaa974 (patch) | |
| tree | ebe579aed10d8cca9b6846fd18804361e8657221 /tools/slangd/language-server.h | |
| parent | fc84455d0d1cb6b9396ba869a17d6f8d4b65ecc6 (diff) | |
Add language server daemon. (#2251)
* Add language server daemon.
* Fix.
Co-authored-by: Yong He <yhe@nvidia.com>
Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
Diffstat (limited to 'tools/slangd/language-server.h')
| -rw-r--r-- | tools/slangd/language-server.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/slangd/language-server.h b/tools/slangd/language-server.h new file mode 100644 index 000000000..829a629b1 --- /dev/null +++ b/tools/slangd/language-server.h @@ -0,0 +1,35 @@ +#pragma once + +#include "../../source/core/slang-io.h" +#include "../../source/core/slang-process-util.h" +#include "../../source/core/slang-string-util.h" +#include "../../source/core/slang-string.h" +#include "../../source/core/slang-writer.h" +#include "../../source/compiler-core/slang-json-rpc-connection.h" +#include "language-server-protocol.h" + +namespace Slang +{ + class LanguageServer + { + public: + RefPtr<JSONRPCConnection> m_connection; + ComPtr<slang::IGlobalSession> m_session; + bool m_quit = false; + List<LanguageServerProtocol::WorkspaceFolder> m_workspaceFolders; + + SlangResult init(const LanguageServerProtocol::InitializeParams& args); + SlangResult execute(); + void update(); + SlangResult didOpenTextDocument( + const LanguageServerProtocol::DidOpenTextDocumentParams& args); + SlangResult didCloseTextDocument( + const LanguageServerProtocol::DidCloseTextDocumentParams& args); + SlangResult didChangeTextDocument( + const LanguageServerProtocol::DidChangeTextDocumentParams& args); + + private: + SlangResult _executeSingle(); + slang::IGlobalSession* getOrCreateGlobalSession(); + }; +} |
