diff options
author | Yuri Rubinsky <chaosus89@gmail.com> | 2023-01-28 09:54:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-28 09:54:41 +0300 |
commit | 2afa175195d0fc885badb60441bef1b31e5e6d05 (patch) | |
tree | 6b797d7d15e06ac36f910c0c765365672c261a44 /editor/plugins/text_shader_editor.cpp | |
parent | a43db5afa4bbec4772be2f296931a6d44bb4cbb3 (diff) | |
parent | 0acaccebaf3b1dc6445f8a100a1011b89faa4216 (diff) | |
download | redot-engine-2afa175195d0fc885badb60441bef1b31e5e6d05.tar.gz |
Merge pull request #72174 from bitsawer/shader_include_fixes
Close undefined
Fix undefined
Diffstat (limited to 'editor/plugins/text_shader_editor.cpp')
-rw-r--r-- | editor/plugins/text_shader_editor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index 1b29999796..ffd9564816 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -383,11 +383,12 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptLa List<ScriptLanguage::CodeCompletionOption> pp_defines; ShaderPreprocessor preprocessor; String code; - complete_from_path = (shader.is_valid() ? shader->get_path() : shader_inc->get_path()).get_base_dir(); + String resource_path = (shader.is_valid() ? shader->get_path() : shader_inc->get_path()); + complete_from_path = resource_path.get_base_dir(); if (!complete_from_path.ends_with("/")) { complete_from_path += "/"; } - preprocessor.preprocess(p_code, "", code, nullptr, nullptr, nullptr, nullptr, &pp_options, &pp_defines, _complete_include_paths); + preprocessor.preprocess(p_code, resource_path, code, nullptr, nullptr, nullptr, nullptr, &pp_options, &pp_defines, _complete_include_paths); complete_from_path = String(); if (pp_options.size()) { for (const ScriptLanguage::CodeCompletionOption &E : pp_options) { |