Fix several shader preprocessor include issues
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user