Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Don't do code completion in shader comments

Simon Döhl8a2dfba9b17b
diff --git a/editor/shader/shader_text_editor.cpp b/editor/shader/shader_text_editor.cpp
index 58892bf5b87..7cd36535a7c 100644
--- a/editor/shader/shader_text_editor.cpp
+++ b/editor/shader/shader_text_editor.cpp
@@ -937,6 +937,11 @@ static void _complete_include_paths(List<ScriptLanguage::CodeCompletionOption> *
}
void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options, bool &r_force) {
+ CodeEdit *editor = code_editor->get_text_editor();
+ if (editor->is_in_comment(editor->get_caret_line(), editor->get_caret_column()) != -1) {
+ return;
+ }
+
List<ScriptLanguage::CodeCompletionOption> pp_options;
List<ScriptLanguage::CodeCompletionOption> pp_defines;
ShaderPreprocessor preprocessor;