mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-22 02:49:29 +03:00
HackStudio: Add autocompletion for GML files
This commit is contained in:
parent
2b5566d7cc
commit
0295cf96a8
Notes:
sideshowbarker
2024-07-18 07:56:02 +09:00
Author: https://github.com/caoimhebyrne Commit: https://github.com/SerenityOS/serenity/commit/0295cf96a88 Pull-request: https://github.com/SerenityOS/serenity/pull/9068
@ -19,6 +19,7 @@
|
||||
#include <LibCpp/SyntaxHighlighter.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/GMLAutocompleteProvider.h>
|
||||
#include <LibGUI/GMLSyntaxHighlighter.h>
|
||||
#include <LibGUI/INISyntaxHighlighter.h>
|
||||
#include <LibGUI/Label.h>
|
||||
@ -480,6 +481,8 @@ void Editor::set_document(GUI::TextDocument& doc)
|
||||
}
|
||||
m_language_client->open_file(code_document.file_path(), fd);
|
||||
close(fd);
|
||||
} else {
|
||||
set_autocomplete_provider_for(code_document);
|
||||
}
|
||||
}
|
||||
|
||||
@ -608,6 +611,17 @@ void Editor::set_syntax_highlighter_for(const CodeDocument& document)
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::set_autocomplete_provider_for(CodeDocument const& document)
|
||||
{
|
||||
switch (document.language()) {
|
||||
case Language::GML:
|
||||
set_autocomplete_provider(make<GUI::GMLAutocompleteProvider>());
|
||||
break;
|
||||
default:
|
||||
set_autocomplete_provider({});
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::set_language_client_for(const CodeDocument& document)
|
||||
{
|
||||
if (m_language_client && m_language_client->language() == document.language())
|
||||
|
@ -97,6 +97,7 @@ private:
|
||||
void flush_file_content_to_langauge_server();
|
||||
void set_syntax_highlighter_for(const CodeDocument&);
|
||||
void set_language_client_for(const CodeDocument&);
|
||||
void set_autocomplete_provider_for(CodeDocument const&);
|
||||
void handle_function_parameters_hint_request();
|
||||
|
||||
explicit Editor();
|
||||
|
Loading…
Reference in New Issue
Block a user