You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Resolve conflict between shader uniform tooltips "/**" and general annotation "/**/".
This commit is contained in:
@@ -313,6 +313,8 @@ void ShaderTextEditor::_load_theme_settings() {
|
|||||||
|
|
||||||
const Color doc_comment_color = EDITOR_GET("text_editor/theme/highlighting/doc_comment_color");
|
const Color doc_comment_color = EDITOR_GET("text_editor/theme/highlighting/doc_comment_color");
|
||||||
syntax_highlighter->add_color_region("/**", "*/", doc_comment_color, false);
|
syntax_highlighter->add_color_region("/**", "*/", doc_comment_color, false);
|
||||||
|
// "/**/" will be treated as the start of the "/**" region, this line is guaranteed to end the color_region.
|
||||||
|
syntax_highlighter->add_color_region("/**/", "", comment_color, true);
|
||||||
|
|
||||||
// Disabled preprocessor branches use translucent text color to be easier to distinguish from comments.
|
// Disabled preprocessor branches use translucent text color to be easier to distinguish from comments.
|
||||||
syntax_highlighter->set_disabled_branch_color(Color(EDITOR_GET("text_editor/theme/highlighting/text_color")) * Color(1, 1, 1, 0.5));
|
syntax_highlighter->set_disabled_branch_color(Color(EDITOR_GET("text_editor/theme/highlighting/text_color")) * Color(1, 1, 1, 0.5));
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ void Shader::get_shader_uniform_list(List<PropertyInfo> *p_params, bool p_get_gr
|
|||||||
DocData::PropertyDoc prop_doc;
|
DocData::PropertyDoc prop_doc;
|
||||||
prop_doc.name = "shader_parameter/" + pi.name;
|
prop_doc.name = "shader_parameter/" + pi.name;
|
||||||
#ifdef MODULE_REGEX_ENABLED
|
#ifdef MODULE_REGEX_ENABLED
|
||||||
const RegEx pattern("/\\*\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*+/\\s*uniform\\s+\\w+\\s+" + pi.name + "(?=[\\s:;=])");
|
const RegEx pattern("/\\*\\*\\s([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*+/\\s*uniform\\s+\\w+\\s+" + pi.name + "(?=[\\s:;=])");
|
||||||
Ref<RegExMatch> pattern_ref = pattern.search(code);
|
Ref<RegExMatch> pattern_ref = pattern.search(code);
|
||||||
if (pattern_ref != nullptr) {
|
if (pattern_ref != nullptr) {
|
||||||
RegExMatch *match = pattern_ref.ptr();
|
RegExMatch *match = pattern_ref.ptr();
|
||||||
|
|||||||
Reference in New Issue
Block a user