summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/register_types.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-08-28 13:10:32 +0200
committerRémi Verschelde <rverschelde@gmail.com>2019-08-28 13:29:37 +0200
commitb994124df3546b351f673304ad227195298b102c (patch)
treee00d674b2bc064e2db633aa356752138ea833606 /modules/gdscript/register_types.cpp
parent46ad60385b68a8af142108715a12a3363ffb3fea (diff)
downloadredot-engine-b994124df3546b351f673304ad227195298b102c.tar.gz
GDScript: Disable LSP if either jsonrpc or websocket are disabled
Follow-up to #29780.
Diffstat (limited to 'modules/gdscript/register_types.cpp')
-rw-r--r--modules/gdscript/register_types.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp
index d07949b34b..94b9e8c2d9 100644
--- a/modules/gdscript/register_types.cpp
+++ b/modules/gdscript/register_types.cpp
@@ -34,10 +34,8 @@
#include "core/io/resource_loader.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
-#include "editor/gdscript_highlighter.h"
#include "gdscript.h"
#include "gdscript_tokenizer.h"
-#include "language_server/gdscript_language_server.h"
GDScriptLanguage *script_language_gd = NULL;
Ref<ResourceFormatLoaderGDScript> resource_loader_gd;
@@ -45,10 +43,15 @@ Ref<ResourceFormatSaverGDScript> resource_saver_gd;
#ifdef TOOLS_ENABLED
-#include "core/engine.h"
#include "editor/editor_export.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
+#include "editor/gdscript_highlighter.h"
+
+#ifndef GDSCRIPT_NO_LSP
+#include "core/engine.h"
+#include "language_server/gdscript_language_server.h"
+#endif // !GDSCRIPT_NO_LSP
class EditorExportGDScript : public EditorExportPlugin {
@@ -137,13 +140,15 @@ static void _editor_init() {
gd_export.instance();
EditorExport::get_singleton()->add_export_plugin(gd_export);
+#ifndef GDSCRIPT_NO_LSP
register_lsp_types();
GDScriptLanguageServer *lsp_plugin = memnew(GDScriptLanguageServer);
EditorNode::get_singleton()->add_editor_plugin(lsp_plugin);
Engine::get_singleton()->add_singleton(Engine::Singleton("GDScriptLanguageProtocol", GDScriptLanguageProtocol::get_singleton()));
+#endif // !GDSCRIPT_NO_LSP
}
-#endif
+#endif // TOOLS_ENABLED
void register_gdscript_types() {
@@ -162,7 +167,7 @@ void register_gdscript_types() {
#ifdef TOOLS_ENABLED
ScriptEditor::register_create_syntax_highlighter_function(GDScriptSyntaxHighlighter::create);
EditorNode::add_init_callback(_editor_init);
-#endif
+#endif // TOOLS_ENABLED
}
void unregister_gdscript_types() {