1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 18:04:59 +00:00

HackStudio: Integrate with C++ Language Server

Editors now communicate with the c++ language server when openning and
editing c++ source files, and go through the language server to get
autocomplete suggestions.
This commit is contained in:
Itamar 2020-09-27 00:11:15 +03:00 committed by Andreas Kling
parent 863f14788f
commit a39c4cc340
13 changed files with 197 additions and 34 deletions

View file

@ -28,11 +28,30 @@
namespace HackStudio {
NonnullRefPtr<CodeDocument> CodeDocument::create(const LexicalPath& file_path, Client* client)
{
return adopt(*new CodeDocument(file_path, client));
}
NonnullRefPtr<CodeDocument> CodeDocument::create(Client* client)
{
return adopt(*new CodeDocument(client));
}
CodeDocument::CodeDocument(const LexicalPath& file_path, Client* client)
: TextDocument(client)
, m_file_path(file_path)
{
if (file_path.basename().ends_with(".cpp") || file_path.basename().ends_with(".h"))
m_language = Language::Cpp;
else if (file_path.basename().ends_with(".js"))
m_language = Language::JavaScript;
else if (file_path.basename().ends_with(".ini"))
m_language = Language::Ini;
else if (file_path.basename().ends_with(".sh"))
m_language = Language::Shell;
}
CodeDocument::CodeDocument(Client* client)
: TextDocument(client)
{