-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add preprocessor pass on visual shader when showing generated code #82570
Add preprocessor pass on visual shader when showing generated code #82570
Conversation
7d5c126
to
60d095b
Compare
Looks pretty good. I would also add the preprocessor error file name, which makes it easier to find the actual issue if you have complex or nested includes. Also, looks like the error line number highlight is off by one, needs if (err != OK) {
ERR_FAIL_COND(err_positions.size() == 0);
String file = err_positions.front()->get().file;
int err_line = err_positions.front()->get().line;
Color error_line_color = EDITOR_GET("text_editor/theme/highlighting/mark_color");
preview_text->set_line_background_color(err_line - 1, error_line_color);
error_panel->show();
error_label->set_text("error(" + file + ":" + itos(err_line) + "): " + error_pp);
shader_error = true;
return;
} |
60d095b
to
7ce0e74
Compare
Thanks! There was another issue with the error line number when there was an error in the included file. Fixed both issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and works as expected. One comment should be updated to the new format (capitalized and ends with a dot), but other than that looks good.
As a note to myself and future maintainers, this code is now pretty similar to ShaderTextEditor version with some small differences, so it might be possible to merge them in the future. No need to do that in this PR, however.
6ab10f7
to
0486d40
Compare
Your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me. I am not familiar with this code, but I trust the other reviewers
Thanks! And congrats for your first merged Godot contribution 🎉 |
Fixes #82555
Add preprocessor pass and check for errors in visual shader editor.