mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 07:18:51 +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
|
@ -57,16 +57,12 @@
|
|||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/CppSyntaxHighlighter.h>
|
||||
#include <LibGUI/FilePicker.h>
|
||||
#include <LibGUI/INISyntaxHighlighter.h>
|
||||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/JSSyntaxHighlighter.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/ShellSyntaxHighlighter.h>
|
||||
#include <LibGUI/Splitter.h>
|
||||
#include <LibGUI/StackWidget.h>
|
||||
#include <LibGUI/TabWidget.h>
|
||||
|
@ -211,17 +207,6 @@ void HackStudioWidget::open_file(const String& filename)
|
|||
current_editor().set_mode(GUI::TextEditor::ReadOnly);
|
||||
}
|
||||
|
||||
if (filename.ends_with(".cpp") || filename.ends_with(".h"))
|
||||
current_editor().set_syntax_highlighter(make<GUI::CppSyntaxHighlighter>());
|
||||
else if (filename.ends_with(".js"))
|
||||
current_editor().set_syntax_highlighter(make<GUI::JSSyntaxHighlighter>());
|
||||
else if (filename.ends_with(".ini"))
|
||||
current_editor().set_syntax_highlighter(make<GUI::IniSyntaxHighlighter>());
|
||||
else if (filename.ends_with(".sh"))
|
||||
current_editor().set_syntax_highlighter(make<GUI::ShellSyntaxHighlighter>());
|
||||
else
|
||||
current_editor().set_syntax_highlighter(nullptr);
|
||||
|
||||
if (filename.ends_with(".frm")) {
|
||||
set_edit_mode(EditMode::Form);
|
||||
} else {
|
||||
|
@ -366,7 +351,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action()
|
|||
|
||||
void HackStudioWidget::add_new_editor(GUI::Widget& parent)
|
||||
{
|
||||
auto wrapper = EditorWrapper::construct(Debugger::on_breakpoint_change);
|
||||
auto wrapper = EditorWrapper::construct();
|
||||
if (m_action_tab_widget) {
|
||||
parent.insert_child_before(wrapper, *m_action_tab_widget);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue