mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-07 02:42:52 +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:
parent
863f14788f
commit
a39c4cc340
Notes:
sideshowbarker
2024-07-19 02:07:05 +09:00
Author: https://github.com/itamar8910
Commit: a39c4cc340
Pull-request: https://github.com/SerenityOS/serenity/pull/3622
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
Reviewed-by: https://github.com/tomuta
13 changed files with 197 additions and 34 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue